boostorg / type_traits

Boost.org type_traits module
http://boost.org/libs/type_traits
62 stars 82 forks source link

add dependent_false #194

Open gpeterhoff opened 9 months ago

gpeterhoff commented 9 months ago

always false idiome dependent_false.hpp

//  Distributed under the Boost Software License Version 1.0 https://www.boost.org/LICENSE_1_0.txt
//  Copyright Gero Peterhoff

#ifndef BOOST_TYPE_TRAITS_DEPENDENT_FALSE_HPP
#define BOOST_TYPE_TRAITS_DEPENDENT_FALSE_HPP

#include <boost/type_traits/integral_constant.hpp>

namespace boost
{
template <typename... Types> struct dependent_false : public false_type{};

#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
template <typename... Types> inline constexpr bool dependent_false_v = dependent_false<Types...>::value;
#endif
}   //  boost

#endif  //  BOOST_TYPE_TRAITS_DEPENDENT_FALSE_HPP
jzmaddock commented 9 months ago

Use case?

gpeterhoff commented 9 months ago

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2593r0.html

https://github.com/cplusplus/papers/issues/572