#include <iostream>
#include <unordered_map>
class A{
public:
A(){}
~A(){}
A(const A& a){std::cout<<"copy constructor"<<'\n';}
void operator=(const A& a){std::cout<<"copy assignment"<<'\n';}
A(const A&& a){std::cout<<"move constructor"<<'\n';}
void operator=(const A&& a){std::cout<<"move assignment"<<'\n';}
};
void main() {
std::unordered_map<int, A> m;
for (int i=0; i<10; ++i) {
m[i] = A();
std::cout << i << ' ' << m.bucket_count() << '\n';
}
std::cout << m.size();
}
sadfsd
沒有留言:
張貼留言