Skip to content

Commit

Permalink
Change mpl::integral_c to boost::integral_constant to avoid Clang 16 …
Browse files Browse the repository at this point in the history
…errors when constructing out of range enums (refs #24, boostorg/mpl#69)

Note: the patch source is
boostorg/numeric_conversion@50a1eae

Please also see boostorg/mpl#69
  • Loading branch information
pdimov authored and ktrushin committed Nov 4, 2024
1 parent 4eff8eb commit 33d8b41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

#include "boost/mpl/integral_c.hpp"
#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'IntFloatMixture'
typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
typedef boost::integral_constant<int_float_mixture_enum, integral_to_integral> int2int_c ;
typedef boost::integral_constant<int_float_mixture_enum, integral_to_float> int2float_c ;
typedef boost::integral_constant<int_float_mixture_enum, float_to_integral> float2int_c ;
typedef boost::integral_constant<int_float_mixture_enum, float_to_float> float2float_c ;

// Metafunction:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include "boost/numeric/conversion/sign_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

#include "boost/mpl/integral_c.hpp"
#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'SignMixture'
typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;

// Metafunction:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"

#include "boost/mpl/integral_c.hpp"
#include "boost/type_traits/integral_constant.hpp"

namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'UdtMixture'
typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;

// Metafunction:
//
Expand Down

0 comments on commit 33d8b41

Please sign in to comment.