Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
derived_tempalte
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <iostream> struct IBase { }; template <typename T> struct CContainer { CContainer() : m_p(nullptr) {} CContainer(T* p) :m_p(p) {} CContainer(CContainer& p) :m_p(p.m_p) {} CContainer& operator=(T* p) { m_p = p; return *this; } CContainer& operator=(CContainer& p) { m_p = p.p; return *this; } operator T*() { return m_p; } protected: T* m_p; }; template <typename T> struct CContainerDerived : public CContainer<T> { CContainerDerived() : CContainer<T>() {} CContainerDerived(IBase* p) { m_p = (T*) p; } }; int main() { }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
std::function ambiguity vc++
MSVC_example_GetAllocLength
Eight Queen
Calculate sum between two numbers using for-, while-, and do-while loops
c++ pure apstraction
C++ standard violation: [templates][explicit instantiation][access checking]
progrm_1
Memory example
wrong up
Computing factorial of an integer with recursion and iteration [EDIT]
Please log in to post a comment.