boost-hana Questions

3

Solved

I'm using c++17 with Boost.hana to write some meta-programming programs. One issue stuck me is what kind of expression can be used in a constexpr context like static_assert. Here is an example: #i...
Crankle asked 25/2, 2020 at 3:33

1

Solved

I would like to find out if a type defines a member function with a template argument but the template argument is constrained with SFINAE. Example I have a type A with a single function foo str...

2

Solved

I need to build a tuple of n types. These n types are value types of n other types. Consider this snippet: #include <boost/hana.hpp> namespace hana = boost::hana; template<class... Type...
Gobble asked 14/6, 2017 at 6:8

1

Solved

Consider the following problem which compiles successfully on Clang 3.8 using -std=c++14. #include <boost/hana.hpp> namespace hana = boost::hana; int main() { constexpr auto indices = han...
Trackman asked 4/6, 2017 at 15:31

2

Solved

I'm trying to create a curried interface using nested constexpr lambdas, but the compiler does not consider it to be a constant expression. namespace hana = boost::hana; using namespace hana::lite...
Bresee asked 27/4, 2017 at 18:38

3

Solved

Making use of Scott Schurr's str_const I have a constexpr string. class StrConst { public: template<size_t N> constexpr StrConst(const char (&str)[N]) : str_(str) , len_(N - 1) { s...
Catalan asked 9/4, 2017 at 22:16

0

Is there a way to use the BOOST_HANA_ADAPT_STRUCT macro for a struct that inherits from a base struct without repeating the accessors of the base struct ? Right now I have something similar to the...
Inconvincible asked 9/4, 2017 at 6:22

2

Solved

I have a hana::tuple_t<int, char, double, float>, and I want to use this to create a hana::tuple<int, char, double, float>. I thought that using hana::to<hana::tuple_tag> would ...
Anorak asked 10/1, 2017 at 17:2

1

Solved

I could not find a way to access real object with hana::for_each iterating over tuples. struct A { std::string name; } struct B { std::string name; } using type_t = decltype(boost::hana::tuple...
Indusium asked 4/10, 2016 at 14:8

1

Solved

I would like to visit a "recursive" std::variant using lambdas and overload-creating functions (e.g. boost::hana::overload). Let's assume I have a variant type called my_variant which can store...
Cypro asked 2/10, 2016 at 17:20

2

Solved

I'm getting started with Boost.Hana and was wondering if there is a way to deserialize back into a Struct that is known to Boost.Hana. I know it's pretty simple to serialize such a Struct into a j...
Pointblank asked 11/10, 2015 at 13:42

1

Solved

I have a number of nested loops with small sizes I, J, ... known at compile time, e.g. for(int i = 0; i < I; ++i) { for(int j = 0; j < J; ++j) { // ... // do sth with (i,j,...) } } I ...
Marcelenemarcelia asked 29/7, 2016 at 7:52

5

Solved

I have an attribute vector that can hold different types: class base_attribute_vector; // no template args template<typename T> class raw_attribute_vector : public base_attribute_vector; r...
Gurgle asked 28/7, 2016 at 18:28

1

Solved

static constexpr auto type_tuple_c = hana::tuple_t<T...>; static constexpr auto idx_tuple_c = hana::tuple_c<std::size_t, 0, sizeof...(T)>; I'd like to map these two sequences of equal...
Illegitimate asked 10/4, 2016 at 21:5

1

Solved

Say I have 2 tuples that are not instantiated. Is there an idiomatic way to check if one set is the subset of the other? If this requires another type instead of hana::tuple_c, this is fine as wel...
Hinge asked 7/1, 2016 at 10:12

1

Solved

#include <string> #include <utility> #include <vector> #include <boost/hana.hpp> namespace hana = boost::hana; template <typename ...T> void indexed_T_work(T&&amp...
Switchback asked 16/10, 2015 at 19:29

1

Solved

Boost Hana provides the ability to introspect on class member fields in a simple and beautiful way: // define: struct Person { std::string name; int age; }; // below could be done inline, but ...
Haslett asked 20/9, 2015 at 11:6
1

© 2022 - 2024 — McMap. All rights reserved.