Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

perfect forwarding

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 1,83 sec, absolute running time: 0,21 sec, absolute service time: 2,06 sec 
edit mode |  history
call foo(non_const_str)
1. non-const lvalue: void foo( std::string& )


call foo(const_str)
2. const lvalue: void foo( const std::string& )


call foo( std::move(non_const_str) )
3. rvalue: void foo( const string&& )


call pass_through(non_const_str)
void pass_through( T&& ) - forwarding lvalue reference
	1. non-const lvalue: void foo( std::string& )


call pass_through(const_str)
void pass_through( T&& ) - forwarding lvalue reference
	2. const lvalue: void foo( const std::string& )


call pass_through( std::move(non_const_str) )
void pass_through( T&& ) - forwarding rvalue reference
	3. rvalue: void foo( const string&& )


    
                
λ
.NET NoSQL database for rapid development