template<class T, class X> class Obj {
T my_t;
X my_x;
public:
Obj(T t, X x) : my_t(t), my_x(x) { }
};
Referring to the sample code above, which one of the
following is a valid conversion operator for the type T?
a) T operator T () { return my_t; }
b) T operator(T) const { return my_t; }
c) operator(T) { return my_t; }
d) T operator T (const Obj &obj) { return obj.my_t; }
e) operator T () const { return my_t; }



template<class T, class X> class Obj { T my_t; X my_x; public: Obj(T t, X ..

Answer / guest

option 'e' is the correct one

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Definition of class?

12 Answers  


Name some pure object oriented languages?

1 Answers  


Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1

4 Answers   Quark,


What is a modifier in c++?

0 Answers  


What is a float in c++?

0 Answers  






When we use Abstract Class and when we use Interface?where we will implement in real time?

0 Answers  


Is c or c++ more useful?

0 Answers  


What are compilers in c++?

0 Answers  


What is the best c c++ compiler for windows?

0 Answers  


How to defines the function in c++?

0 Answers  


what is difference between static and non-static variables

10 Answers  


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

0 Answers  


Categories