c++ - Constructor inheritance for class derived from template class in visual studio 2015 rc -
according page of msvs2015rc new features constructor inheritance should supported. yes, works in simple cases this:
struct b { b(int) {} }; struct d : b { using b::b; // can create d object b's constructor };
but if i'll try create more complex example:
template <class t> struct b { b(int) {} }; template <template <class> class c, class t> struct d : c<t> { using c<t>::c; }; int main() { d<b,int> d(42); return 0; }
i've got compiler errors:
error c2039: 'c': not member of 'b<t>'
error c2873: 'c': symbol cannot used in using-declaration
error c2664: 'd<b,int>::d(d<b,int> &&)': cannot convert argument 1 'int' 'const d<b,int> &'
i can eliminate these errors if , if rename template template class c
b
:
template <template <class> class b, class t> struct d : b<t> { using b<t>::b; };
i think compiler bug because of these codes compiled gcc/clang.
do has opinion issue?
it bug in msvc , appears in latest version provide online. so, please, submit bug report. relevant discussion might found in other question. contains excerpts standard explain why should work.
Comments
Post a Comment