Last active
December 18, 2015 23:39
-
-
Save borisbat/5863559 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Report | |
{ | |
public: | |
Report() { cout << "Report();" << endl; } | |
Report(const Report & ) { cout << "Report(const & Report);" << endl; }; | |
Report(Report &&) { cout << "Report(&&);" << endl; } | |
Report & operator = (const Report &) { cout << "Report::=(const Report &);" << endl; return *this; }; | |
}; | |
template <typename Tc, typename T> | |
void push1 ( Tc & c, T t ) | |
{ | |
c.push_back(move(t)); | |
} | |
template <typename Tc, typename T> | |
void push2 ( Tc & c, const T & t ) | |
{ | |
c.push_back(t); | |
} | |
int main(int argc, const char * argv[]) | |
{ | |
vector<Report> a, A; | |
Report b; | |
cout << "push1" << endl; | |
push1(a, b); | |
cout << "push2" << endl; | |
push2(A, b); | |
return 0; | |
} | |
/* | |
Report(); | |
push1 | |
Report(const & Report); | |
Report(&&); | |
push2 | |
Report(const & Report); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment