Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
VS'15 parameter pack sfinae
boost::synchronize
Hangman
Unicode_wcout
sinem çalışma
Visual Studio 2015 Compiler Bug: 64bit multiplication
list multiply
#19
Chord Note Finder
Noexcept
Please log in to post a comment.