Consider the following:
template <class T>
struct myclass
{
using value_type = T;
constexpr myclass() = default;
constexpr myclass(const myclass& other) = default;
constexpr myclass(const myclass&& other) = default;
T value;
};
- To what constructor bodies these function are equivalent?
- Does
myclass<int> x;
initialize the integer at0
? - For
myclass<std::vector<int>> x;
what does the default move constructor do? Does it call the move constructor of the vector?
Aucun commentaire:
Enregistrer un commentaire