Skip to content

Instantly share code, notes, and snippets.

@cjxgm
Created October 6, 2014 15:41
Show Gist options
  • Save cjxgm/b2c51b6dc9576102faeb to your computer and use it in GitHub Desktop.
Save cjxgm/b2c51b6dc9576102faeb to your computer and use it in GitHub Desktop.
tranferability constrain mixin
namespace mixin
{
struct no_copy_ctor { no_copy_ctor() = default; no_copy_ctor(no_copy_ctor const&) = delete; };
struct no_copy_assign { no_copy_assign& operator=(no_copy_assign const&) = delete; };
struct non_copyable : no_copy_ctor, no_copy_assign {};
struct no_move_ctor { no_move_ctor() = default; no_move_ctor(no_move_ctor &&) = delete; };
struct no_move_assign { no_move_assign& operator=(no_move_assign &&) = delete; };
struct non_movable : no_move_ctor, no_move_assign {};
struct non_transferable : non_copyable, non_movable {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment