Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
261 views

Use the value of strongly typed enum as index in boost::mpl::map

I am using a C++ map structure defined similar to std::map<Foo, std::any> for storing attributes of a compiler symbol table. The Foo is a strongly typed enum, such as enum class Foo {ENUM}. ...
Snow Summer's user avatar
3 votes
3 answers
501 views

Cartesian product of multiple templates

I have a few classes: template <int,char> class Foo{}; template <int,char> class Bar{}; And I want to get all combinations with a few arguments, like this: // {1, 2}, {'a', 'b'} using ...
Igor Pugachev's user avatar
1 vote
1 answer
227 views

Compile-time Size of Struct Minus Padding

I'm trying to use Boost MPL and Fusion to calculate the size of a struct exclusive of any padding. This is my current best attempt: Live example template<class T> constexpr std::size_t ...
bhillam's user avatar
  • 191
0 votes
1 answer
237 views

Does std::variant provide functionality similar to boost::variant<>::types?

boost::variant exposes its list of variant types via boost::variant<>::types, which can be conveniently used with boost::mpl::for_each. std::variant is missing such a member. I see std::...
Braden's user avatar
  • 1,507
0 votes
1 answer
1k views

Replacing Boost MPL containers with C++17 features

I have some old code based on MPL containers, using enable_if to to activate some dispatch like this: typedef boost::mpl::vector<std::int16_t, std::int32_t, int64_t, float, double, std::complex<...
Matthieu Brucher's user avatar
4 votes
1 answer
254 views

Boost MPL Sorting Template Parameter Pack

The problem I'm trying to solve is to sort a template parameter pack according to the return value of a constexpr templated function specialized for each of the types I'm sorting. I have a list of ...
user3831357's user avatar