Skip to content

Instantly share code, notes, and snippets.

@badair
Last active May 25, 2016 19:10
Show Gist options
  • Save badair/fb310dd0ce18685ad9a57958d1bb3950 to your computer and use it in GitHub Desktop.
Save badair/fb310dd0ce18685ad9a57958d1bb3950 to your computer and use it in GitHub Desktop.
This is a reply to the first comment on my StackOverflow answer here: http://stackoverflow.com/a/37444724/2397809

The interface and behavior for the following traits and metafunctions (as they currently stand on the CallableTraits develop branch) are unlikely to change, for the most part. I explain what I mean by "for the most part" after this list:

  • add_member_const
  • add_member_volatile
  • add_member_cv
  • add_member_lvalue_reference
  • add_member_rvalue_reference
  • add_varargs
  • remove_member_const
  • remove_member_cv
  • remove_member_reference
  • remove_member_volatile
  • remove_varargs
  • is_const_member
  • is_cv_member
  • is_volatile_member
  • is_lvalue_reference_member
  • is_rvalue_reference_member
  • is_reference_member
  • has_varargs
  • has_void_return
  • has_member_qualifiers
  • remove_member_pointer
  • apply_member_pointer
  • arg_at
  • args
  • expand_args
  • function_type

All other library features in CallableTraits are either back on the drawing board, or on the chopping block. Although I'm still working to achieve 100% coverage, most (if not all) of the features listed above are thoroughly tested. Although relatively stable, some things may change as the library approaches version 1.0:

  1. The library may adopt a <type_traits>-style interface, where the following assert will not fail:

    static_assert(std::is_same<typename add_member_const::type, add_member_const_t>::value, "");

I haven't decided whether to do this yet -- I would like to receive feedback first. The <type_traits> approach is more friendly to higher-order metafunctions and lazy template instantiations. It's also simply more conventional.

  1. Invalid template parameters may be handled differently.

  2. Currently, the features above do not account for C++17 transaction_safe or C++17 noexcept. These will be handled before 1.0 is released.

I hope this answers your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment