Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize Trait Style #86

Open
akleeman opened this issue Mar 11, 2019 · 0 comments
Open

Standardize Trait Style #86

akleeman opened this issue Mar 11, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@akleeman
Copy link
Collaborator

As @jbangelo suggested it'd be nice to switch the trait inspection style from something like this:

template <typename X> class is_complete {
  template <typename T, typename = decltype(!sizeof(T))>
  static std::true_type test(int);
  template <typename T> static std::false_type test(...);

public:
  static constexpr bool value = decltype(test<X>(0))::value;
};

to something like this:

template<typename T, typename = void>
struct is_complete : std::false_type { };

template<typename T>
struct is_complete<T, typename std::enable_if<sizeof(T) != 0>::type> : std::true_type { };
@akleeman akleeman added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 11, 2019
@akleeman akleeman mentioned this issue Mar 11, 2019
@akleeman akleeman removed the good first issue Good for newcomers label Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant