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
the first character in the variable name must be an a) special symbol b) number c) alphabet
What are files in c++?
What is the difference between a template and a macro?
When should we use container classes instead of arrays?
What is auto used for in c++?
What is the best c++ compiler for windows 10?
What is the difference between passing by reference and passing a reference?
Differentiate between an external iterator and an internal iterator?
What is the main function c++?
What are the uses of static class data?
Why do we use constructor?
What is math h in c++?
What are c++ templates used for?
What is an adjust field format flag?
What is array in c++ example?