Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
operator/function lookup
#include <iostream> namespace ns { void f(...) { std::cout << "f#1" << std::endl; } struct X { void operator *() const { std::cout << "*#1" << std::endl; } void operator +() const { std::cout << "+#1" << std::endl; } }; template<typename T> void g(T&& a, X b) { f(a); f(b); f(X{}); *a; *b; *X{}; +a; +b; +X{}; } void f(X&) { std::cout << "f#2" << std::endl; } void f(X&&) { std::cout << "f#3" << std::endl; } void operator*(X&) { std::cout << "*#2" << std::endl; } void operator*(X&&) { std::cout << "*#3" << std::endl; } } void operator+(ns::X&) { std::cout << "+#2" << std::endl; } void operator+(ns::X&&) { std::cout << "+#3" << std::endl; } int main() { g(ns::X{}, ns::X{}); }
run
|
edit
|
history
|
help
0
xyz1_1 programm
Increment pointer to struct
define_xml_tags
Computing factorial of an integer with recursion and iteration [EDIT]
Struct packing
Strings
Two-phase sample with Visual C++ 2015
PTaHHHa
dhar1
c++ eval - double numbers v1.0