Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Copy initialization: overload resolution issue
#define ENABLE_CONST_OPERATOR 0 #include <iostream> using std::cout; struct A { A() = default; template <typename T> A(T&&) { cout << "template constructor\n"; } }; struct B { operator A() { cout << "non-const operator\n"; return { }; } #if ENABLE_CONST_OPERATOR operator A() const { cout << "const operator\n"; return { }; } #endif }; struct C: B { }; void check(A) { } int main() { cout << "const operator enabled: " << ENABLE_CONST_OPERATOR << "\n\n"; cout << "copy from prvalues " "\n"; std::cout << " B to A: "; check(B()); std::cout << " C to A: "; check(C()); cout << "\n" "copy from const lvalues: " "\n"; cout << " B to A: "; const B b; check(b); cout << " C to A: "; const C c; check(c); }
run
|
edit
|
history
|
help
0
Build char string (multibyte) with wchar
Workaround for https://github.com/Project-OSRM/osrm-backend/pull/4385
Noexcept
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Additional layer of indirection
Ελλάδα !!!!
IBE FT ParseFileName
cv4_template
div64 inline asm
delete from list