Type trait for moveable types?

后端 未结 6 1962
刺人心
刺人心 2020-12-17 14:33

I\'m trying to write a template that behaves one way if T has a move constructor, and another way if T does not. I tried to look for a type trait that could identify this b

6条回答
  •  一生所求
    2020-12-17 14:48

    It's called std::is_move_constructable. There is also std::is_move_assignable. They are both in the C++0x header.

提交回复
热议问题