#include <cstddef> //size_ttemplate<size_t SIZE>class FixedString{public: operator const char*(); void operator =(const char*); void operator =(const FixedString&); // Disallowprivate: template<size_t OTHERSIZE> void operator=(const FixedString<OTHERSIZE>&);}; int main(){ FixedString<10> buf1; FixedString<20> buf2; buf2 = buf1; // NO ERROR!!}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:14:10: error: ‘void FixedString<SIZE>::operator=(const FixedString<OTHERSIZE>&) [with unsigned int OTHERSIZE = 10u; unsigned int SIZE = 20u]’ is private prog.cpp:22:12: error: within this context
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!