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
What is a namespace in c++?
What is the protected keyword used for?
How is modularity introduced in C++?
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?
What is a .h file c++?
What are the extraction and insertion operators in c++? Explain with examples.
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
What are the advantages of using friend classes?
What is a c++ map?
Describe linkages and types of linkages?
Why is c++ considered difficult?
What is object in c++ wikipedia?
Please explain the reference variable in c++?
Why do we use iterators?
Define namespace in c++?