Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- class W {
- public:
- W() { std::cout << "W()\n"; }
- W(int a) : a_(a) { std::cout << "W(int a)\n"; }
- int get_a() { return a_; }
- private:
- int a_;
- };
- void foo(W bar) {
- std::map<int, W> map;
- map[bar.get_a()] = bar;
- }
- int main() {
- foo(W(10));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement