We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
void_t
template<typename T, typename = void> struct HasReference : std::false_type {}; template<typename T> struct HasReference<T, std::void_t<typename T::reference>> : std::true_type {};
[1] CppCon 2014: Walter E. Brown "Modern Template Metaprogramming: A Compendium, Part II"
is_same_v
constexpr if
template<typename Iterator> Iterator next(Iterator iter, std::ptrdiff_t dist) { using category = typename std::iterator_traits<Iterator>::iterator_category; constexpr if(std::is_base_of_v<std::random_access_iterator_tag, category>) return iter + dist; else constexpr if(std::is_base_of_v<std::input_iterator_tag, category>) { for(std::ptrdiff_t i = 0; i < dist; ++i) ++iter; return iter; } }
std::conjunction/std::disjunction/std::negation
template<typename... TArgs, typename... UArgs> struct BeExplicit: std::conjunction<std::is_constructible<TArgs, UArgs>..., std::disjunction<std::negation<std::is_convertible<UArgs, TArgs>>...>> {};
template<auto>
template <auto x> constexpr auto constant = x; constant<true> c1; constant<2> c2;
std::tuple t{1, 2.0, "haha"s}; //std::tuple<int, double, std::string> std::unique_ptr handle{::CreateFile(xxx), [](auto h) noexcept { ::CloseHandle(h); }};
The text was updated successfully, but these errors were encountered:
wuye9036
No branches or pull requests
void_t
idiom[1][1] CppCon 2014: Walter E. Brown "Modern Template Metaprogramming: A Compendium, Part II"
借助于 C++ 14 的 variable templates:
is_same_v
...constexpr if
可以干掉 Tag Dispatch:
std::conjunction/std::disjunction/std::negation
template<auto>
The text was updated successfully, but these errors were encountered: