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; }
Answer Posted / guest
option 'e' is the correct one
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can you overload the operator+ for short integers?
What is the use of data hiding?
What is static in c++?
What are the advantages of using typedef in a program?
daily Routine of father
How long does it take to get good at leetcode?
What is the difference between a baller and a reference in C++?
What is virtual base class uses?
What is the use of namespace std in C++?
What is anonymous object in c++?
When to use “const” reference arguments in a function?
Out of fgets() and gets() which function is safe to use and why?
Is c++ map a hash table?
What is pure virtual function?
Which software is used for c++ programming?