These are chat archives for boostorg/hana

26th
Nov 2015
Louis Dionne
@ldionne
Nov 26 2015 00:25

What is the rationale with 'forwarding' an object you are calling a member function on?
Sorry if that is a whole can of worms. I think I get that f could be an rvalue and this maintains that status.

It's mostly for the sake of genericity. Since I can forward, I do. However, if the operator() of the function was more optimized on rvalues, we would get that optimization. I doubt this would ever happen, truly.

Maik Klein
@MaikKlein
Nov 26 2015 00:30
Is there something that shows me if there are duplicates in a typelist?
something like is_unqiue<Ts...>?
or has_duplicates<Ts...>
Louis Dionne
@ldionne
Nov 26 2015 00:34
@MaikKlein It will be pretty damn inefficient (don’t do it with large type lists), but you can use hana::set for this. hana::length(hana::to_set(hana::tuple_t<T…>)) == sizeof…(T) should give you what you want. Until hana::set has a decent implementation, like I said, this is going to be nasty on the compiler.
Maik Klein
@MaikKlein
Nov 26 2015 00:36
would it be faster it I transform a typelist with "count"?
  auto types = hana::tuple_t<Ts...>;
  auto type_count = hana::transform(types, [&](auto t){
      return hana::count(types, t);
  });
like this?
Louis Dionne
@ldionne
Nov 26 2015 00:37
Like hana::transform(types, [](auto t) { return hana::count(types, t); }) and then check whether any of these counts is >= 2?
Maik Klein
@MaikKlein
Nov 26 2015 00:37
yeah
Louis Dionne
@ldionne
Nov 26 2015 00:37
Right. It’s worth trying it out
Try both for a tuple with 50 elements of different types and let me know the result, would you?
Maik Klein
@MaikKlein
Nov 26 2015 00:38
will do
what would be the "fastest" way to do the >=2 check?
fold_right?
and then or the bools
Louis Dionne
@ldionne
Nov 26 2015 01:05
template <typename Foldable>
/*constexpr*/ auto has_duplicates(Foldable const& foldable) {
    return hana::unpack(foldable, [&](auto const& ...x) {
        constexpr std::size_t counts[] = {
            decltype(hana::count(foldable, x))::value...
        };
        return hana::bool_c<
            hana::detail::find_if(counts, counts + sizeof...(x), hana::_ > 1u)
                !=
            counts + sizeof...(x)
        >;
    });
}
Just #include <boost/hana.hpp> and namespace hana = boost::hana for it to work.
This should actually be decently fast. Not very fast (and still O(n^2)), but probably much better than the hana::set solution I gave you above.
@MaikKlein If you try both, I’d be curious to see the bench results, really.
Jason Rice
@ricejasonf
Nov 26 2015 01:23
types? or would int_c's suffice for the tests?
Louis Dionne
@ldionne
Nov 26 2015 01:26
Yeah, basically we need an heterogeneous tuple, not a hana::tuple<T, T, T, …, T>.
Any objects whose types are different one from the other will work.
Jason Rice
@ricejasonf
Nov 26 2015 02:14
Just for the heck of it, I tried comparing the sizes of the list and a sorted unique version of the list... it crapped out with a fatal error about 256 levels of recursion.
Louis Dionne
@ldionne
Nov 26 2015 02:15
Can you please post the code?
Jason Rice
@ricejasonf
Nov 26 2015 02:15

namespace hana = boost::hana;

auto list_with_no_dups =
  hana::unpack(
    hana::range_c<int, 0, 50>,
      [](auto... i) {
        return hana::tuple_c<int, i...>;
      });

auto list_with_dups =
  hana::unpack(
    hana::range_c<int, 0, 50>,
      [](auto... i) {
        return hana::tuple_c<int, (i % 10)...>;
      });

template <typename Foldable>
/*constexpr*/ auto has_duplicates(Foldable const& foldable) {
  return hana::unpack(foldable, 
      [&](auto const& ...x) {
          constexpr std::size_t counts[] = {
              decltype(hana::count(foldable, x))::value...
          }; 
        return hana::bool_c<
            hana::detail::find_if(counts, counts + sizeof...(x), hana::_ > 1u)
                !=
            counts + sizeof...(x)
        >;
  }); 
}

int main() {
  BOOST_HANA_CONSTANT_CHECK(!has_duplicates(list_with_no_dups));
  BOOST_HANA_CONSTANT_CHECK(has_duplicates(list_with_dups));
}
I deleted my non-working version
that is your version in its place
Louis Dionne
@ldionne
Nov 26 2015 02:17
Yup, this one works fine (but it’s kinda slow still)
The problem is almost surely in hana::sort. I’ve tried optimizing it, but there’s still work to do. See boostorg/hana#205.
Maik Klein
@MaikKlein
Nov 26 2015 02:50
Is there a reasonable way to debug metaprograms?
Louis Dionne
@ldionne
Nov 26 2015 02:52
lol

Usually, no. You can see various types by using the following idiom:

template <typename>
struct show;

template <typename T>
void deeply_nested_function() {
    // Here, I want to see what is T:

    using foo = typename show<T>::baz;
}

This will cause the compiler to vomit an error containing the type T.

This is one of many similar tricks, but really you just have to get used to it until we have better tools for it.
Also, using -ftemplate-backtrace-limit=0 can help as it will show the whole instantiation backtrace when there’s a failure.
When you have a problem, try to reduce the test case more and more while always keeping the same error. Eventually, you’ll get to something simple enough that still triggers the error and you’ll just be like “oh, well now the error is obvious”.
Maik Klein
@MaikKlein
Nov 26 2015 02:56
hm okay that's what I thought.
Louis Dionne
@ldionne
Nov 26 2015 02:57
Of course, if you think that is something Hana could reasonably catch for you, you can file an issue.
Yes, I have.
Maik Klein
@MaikKlein
Nov 26 2015 02:59
Do you think it would be possible to print stuff the the console? like print(hana::tuple_t<Foo,Bar,Baz>); Maybe with some compiler specific stuff?
Louis Dionne
@ldionne
Nov 26 2015 02:59
In my experience, it is not terribly helpful to debug complex metaprograms because one would actually need to walk the template instantiations step by step.

Do you think it would be possible to print stuff the the console? like print(hana::tuple_t<Foo,Bar,Baz>); Maybe with some compiler specific stuff?

That would be possible, and useful.

Maik Klein
@MaikKlein
Nov 26 2015 03:00
I started metaprogramming in D and you can print pretty much anything, kinda miss that in c++
Louis Dionne
@ldionne
Nov 26 2015 03:00
However, something essentially equivalent to this is already given to you by the show trick I explained above.
Maik Klein
@MaikKlein
Nov 26 2015 03:08
But overall I quite like hana so far
Louis Dionne
@ldionne
Nov 26 2015 03:18
Well thanks! While nowhere near perfect, it’s already much better than MPL and Fusion in terms of usability. At least you get to use a decent syntax.
And I think it will only get better with C++ evolving, so it’s looking good.
Jason Rice
@ricejasonf
Nov 26 2015 03:30
I bet you're itching for constexpr lambda :P
This message was deleted
Maik Klein
@MaikKlein
Nov 26 2015 03:32
I started metaprogramming in C++14 a few days ago and I didn't run into many issues which was surprising. I wrote my own "library" but I now switched to hana.
The only problem I have is that I often think that I could do stuff more easily.
For example:
template<class... Ts, class T>
constexpr auto contains(T){
  return hana::contains(hana::tuple_t<Ts...>, hana::type_c<T>);
}
template<class... Ts, class Tup, class F>
auto tuple_map_filter(Tup&& tup, F&& f){
  auto filter_types = [&](auto n, auto acc) {
    return hana::if_(contains<Ts...>(n), hana::prepend(acc, f(n)), acc);
  };
  return hana::fold_right(std::forward<Tup>(tup), hana::make_tuple(), filter_types);
}
Maik Klein
@MaikKlein
Nov 26 2015 03:41
hm I probably should explicitly capture f
Louis Dionne
@ldionne
Nov 26 2015 03:43

Isn't this equivalent to the following?

template<class... Ts, class Tup, class F>
auto tuple_map_filter(Tup&& tup, F&& f){
  return hana::transform(hana::filter(std::forward<Tup>(tup), contains<Ts...>), f);
}

Of course, contains<Ts...> won't work as-is, but you get the idea.

But regardless, what you wrote should work, shouldn’t it?
Maik Klein
@MaikKlein
Nov 26 2015 03:46
Would filter run at run or at compile time?
because I have code that looks sort of like this
auto vtuple = hana::make_tuple(vector<int>{1,2,3}
                                ,vector<float>{1,2,3}
                                ,vector<double>{1,2,3});
and I don't want to copy every vector in a new tuple
Jason Rice
@ricejasonf
Nov 26 2015 03:48
It could do both I would think depending on what you give it.
Maik Klein
@MaikKlein
Nov 26 2015 03:48
in my "own" code I used indices for this
depending on f?
Louis Dionne
@ldionne
Nov 26 2015 03:49
What do you mean, “would filter run at runtime or compile time”?
Of course filter is going to run at runtime, but that’s not your question I’m sure.
Basically, filter([x1, …, xn], pred) is equivalent to make_tuple(xi…) for all xi such that pred(xi) is true.
But pred(xi) is never actually called at runtime.
Now if you have vtuple as above and you write filter(vtuple, pred), then the resulting tuple will contain copies of the elements of vtuple that satisfy pred.
But if you write filter(std::move(vtuple), pred), then it will move the elements that satisfy pred into a new tuple, so no copy.
Maik Klein
@MaikKlein
Nov 26 2015 03:52
yeah that was the question :), I used the types to filter the tuple at compiletime by creating indices, then I used the indices to "map/transform"
template <std::size_t... Is, typename F, typename T>
auto map_filter_tuple(std::index_sequence<Is...>, F&& f, T&& t)
{
    return std::make_tuple(f(std::get<Is>(t))...);
}
so basically I would have to make it a bit different, by only passing in a type tuple right?
^ *The code doesn't handle duplicates.
Louis Dionne
@ldionne
Nov 26 2015 03:56
No. For example
auto vtuple = hana::make_tuple(vector<int>{1,2,3}
                            ,vector<float>{1,2,3}
                            ,vector<double>{1,2,3});

auto new_tuple = hana::filter(std::move(vtuple), [](auto v) {
    assert(false); // this function is never called at runtime anyway

    using T = typename decltype(v)::value_type;
    return std::is_floating_point<T>{};
});

assert(new_tuple == hana::make_tuple(vector<float>{1,2,3}, vector<double>{1,2,3}));
What about duplicates?
Maik Klein
@MaikKlein
Nov 26 2015 04:00
Oh nvm, I rewrote the function a couple of times. I was just confused.
Jason Rice
@ricejasonf
Nov 26 2015 04:00
Is there something like std::forward_as_tuple for references?
Maik Klein
@MaikKlein
Nov 26 2015 04:05
The problem that I have with filter is that it creates a new tuple, but I just want to run a function on that "value". A real life example would be an entity component system where you can say at compile time, Give me Components1, Components2, Components3. I then would filter it at compile time and extract the iterator into a new tuple.
  auto vtuple = hana::make_tuple(vector<int>{1,2,3}
                                ,vector<float>{1,2,3}
                                ,vector<double>{1,2,3});
  auto int_double_range_tup = tuple_map_filter<vector<int>
                                              ,vector<double>>
                                              (vtuple, [](auto& t){
      return ranges::view::all(t);
  });
  auto int_double_range = hana::unpack(int_double_range_tup, [](auto... t){
      return ranges::view::zip(t...);
  });
  for(auto r: int_double_range){
  }
Something like this, I probably would also have to use indices in hana.
this is https://github.com/ericniebler/range-v3 btw if you are curious.
Louis Dionne
@ldionne
Nov 26 2015 04:09
Can’t you use a tuple of std::refs?
Maik Klein
@MaikKlein
Nov 26 2015 04:09
probably
Jason Rice
@ricejasonf
Nov 26 2015 04:09
ah
Louis Dionne
@ldionne
Nov 26 2015 04:09
Views will be implemented in the future, but for now this would be the only way I see.
Maik Klein
@MaikKlein
Nov 26 2015 04:11
yeah I will just use indices, it was not very hard. I think it was still under <40Loc and that without a nice metaprogramming library :)
Louis Dionne
@ldionne
Nov 26 2015 04:12
And @ricejasonf , I’m reluctant to allow references inside containers because of https://github.com/boostorg/hana/pull/179#issuecomment-139915710.
@MaikKlein The metaprogramming library isn’t that nice if you can’t use it for your use case.
@MaikKlein Anyway, it’s unclear to me exactly what you’re trying to achieve, but if you must filter anything then it would most likely be shorter to write (and more compile-time efficient) with Hana, because there’s quite a bit of logic required for filtering.
Jason Rice
@ricejasonf
Nov 26 2015 04:16
I used std::ref and it worked fine.
Also pulling in std::tuple and using std::forward_as_tuple worked and even had like 50 less bytes in the target :P
Louis Dionne
@ldionne
Nov 26 2015 04:18
I must admit being surprised by that.
By the way, I think it was you who were playing around with large tuples of std::vectors and noticing huge bloat?
I pinned it down to the symbols of the constructors of hana::tuple being f*cking huge and not removed from the executable.
Even with -Os and after stripping it’s still there, bloating the executable.
However, if you enable -fltoand then strip, you’ll see that it’s about as good as passing a good old struct with the same members.
Maik Klein
@MaikKlein
Nov 26 2015 04:20
yeah my use case is probably very specific, I am going to implement it now. I can make a PR and you can have a look at it with a more "reasonable" example.
Louis Dionne
@ldionne
Nov 26 2015 04:21
Sure, just open an issue and I’ll have a look. Thanks.
If possible, make it self-contained so that I can compile it on its own. That makes everything much easier.
Maik Klein
@MaikKlein
Nov 26 2015 04:22
yeah
Jason Rice
@ricejasonf
Nov 26 2015 04:23
@ldionne What suprises you? The code size difference or that std::ref worked?
Louis Dionne
@ldionne
Nov 26 2015 04:23
@ricejasonf The code size difference.
Jason Rice
@ricejasonf
Nov 26 2015 04:24
That's 50 bytes out of like 750k in my monolithic test executable.
:P
Louis Dionne
@ldionne
Nov 26 2015 04:24
Oh, right. Then I’m not surprised.
Maik Klein
@MaikKlein
Nov 26 2015 04:24
ah nice wandbox supports hana, I am going to post it there
Louis Dionne
@ldionne
Nov 26 2015 04:26
@MaikKlein Nope it does not support Hana. There’s only a very old version of Hana that I once uploaded and I put up a link in the README. But now I can’t update the version of Hana that’s used because Wandbox won’t let me update large enough payloads.
So basically the “try it online” link in the README, which I assume is what you’re referring to, is pretty outdated.
And apart from that you won’t be able to use Hana on a pristine Wandbox page.
Maik Klein
@MaikKlein
Nov 26 2015 04:27
:/
Louis Dionne
@ldionne
Nov 26 2015 04:27
Yeah, I know.
Maik Klein
@MaikKlein
Nov 26 2015 15:54
How do you create a tuple of refs?
  auto vt1 = hana::transform(vtuple, [](auto& v) {return std::ref(v);});
like this?
Jason Rice
@ricejasonf
Nov 26 2015 17:10
I did something like that last night
    hana::for_each(
      hana::make_tuple(
        std::ref(x1),
        std::ref(x2),
        std::ref(xs)...),
      [&](auto&& x) {
        nbdl::bind(Read(*iter++), std::forward<decltype(x)>(x));
      });
so x1, x2, and xs... were references
Maik Klein
@MaikKlein
Nov 26 2015 17:44
template<class... Ts, class T>
constexpr auto contains(T){
  return hana::contains(hana::tuple_t<Ts...>, hana::traits::remove_reference(hana::type_c<T>));
}
int main()
{
  auto vtuple = hana::make_tuple(vector<int>{1,2,3}
                                ,vector<float>{1,2,3}
                                ,vector<double>{1,2,3});
  auto vt1 = hana::transform(vtuple, [](auto& v) ->auto& {return v;});

  auto c = [&](auto& t){return contains<std::vector<int>
                                       ,std::vector<float>>(t);};
  auto vt2= hana::filter(vt1, c);
  auto vt3 = hana::transform(vt2, [](auto&& t){
      return hana::make_tuple(t.begin(), t.end());
  });
  auto vt4 = hana::transform(hana::filter(vt1, c), [](auto&& t){
      return hana::make_tuple(t.begin(), t.end());
  });
  auto vt5 = vt3[hana::int_c<0>];
  auto vt6 = vt4[hana::int_c<0>];
  for(auto first = vt5[hana::int_c<0>], end = vt5[hana::int_c<1>]; first != end; ++first){
    std::cout << *first << std::endl;
  }
  for(auto first = vt6[hana::int_c<0>], end = vt6[hana::int_c<1>]; first != end; ++first){
    //stack corruption
    std::cout << *first << std::endl;
  }
Any idea why I get a stack corruption there?
Jason Rice
@ricejasonf
Nov 26 2015 18:11
This probably doesn't touch on your problem, but I don't think you need remove_reference on your hana::type_c<T>
and your vt1 is a tuple of copies of vtuple
Maik Klein
@MaikKlein
Nov 26 2015 18:12
really?
Jason Rice
@ricejasonf
Nov 26 2015 18:13
Weren't you using std::ref there?
Maik Klein
@MaikKlein
Nov 26 2015 18:13
I was in the beginning
but I wasn't sure how to peel off the reference_wrapper
with hana
so I could compare the types
Jason Rice
@ricejasonf
Nov 26 2015 18:25
what is the expected output?
Maik Klein
@MaikKlein
Nov 26 2015 18:26
1
2
3
for both
but the second version prints something on the stack
Jason Rice
@ricejasonf
Nov 26 2015 18:26
yeah i get this
1
2
3
25623856
0
3
Maik Klein
@MaikKlein
Nov 26 2015 18:27
yeah
the last 3 elements should also be 1,2,3
Jason Rice
@ricejasonf
Nov 26 2015 18:32
it looks like the only difference between vt3 and vt4 is that in your call to transform, xs is an rvalue for vt4
Maik Klein
@MaikKlein
Nov 26 2015 18:35
yeah
Jason Rice
@ricejasonf
Nov 26 2015 18:40
This message was deleted
This message was deleted
Jason Rice
@ricejasonf
Nov 26 2015 18:48
so t in vt4 is an rvalue so the iterators point to an expired rvalue
Maik Klein
@MaikKlein
Nov 26 2015 18:52
yeah because as you have said vt1 is a copy not a reference :(
so I probably have to use std::ref
but do you know how I can transform reference_wrapper<T> to T?
Louis Dionne
@ldionne
Nov 26 2015 18:53

auto vt1 = hana::transform(vtuple, [](auto& v) ->auto& {return v;});

This creates a copy of vtuple, nothing more. Use std::ref instead.

but do you know how I can transform reference_wrapper<T> to T?

Use ref.get().

Jason Rice
@ricejasonf
Nov 26 2015 18:53
typename T::type would work assuming it s a reference wrapper
oh
Louis Dionne
@ldionne
Nov 26 2015 18:54
Or if you want to get it right, start by using pointers. This way, everything will be very explicit. Finally, when you get it to work, use std::ref instead of raw pointers.
Maik Klein
@MaikKlein
Nov 26 2015 18:57
Does this mean I would need multiple overloads for my "contains" function like this?
template<class... Ts, class T>
constexpr auto contains(T){
  return hana::contains(hana::tuple_t<Ts...>, hana::type_c<T>);
}
template<class... Ts, class T>
constexpr auto contains(std::reference_wrapper<T>){
  return hana::contains(hana::tuple_t<Ts...>, hana::type_c<T>);
}
Jason Rice
@ricejasonf
Nov 26 2015 19:34
you'd still have the problem when you call t.begin()
Maik Klein
@MaikKlein
Nov 26 2015 19:36
yeah I would have to handle it myself when calling it
template<class T, class... Ts>
constexpr auto contains(){
  return hana::contains(hana::tuple_t<Ts...>, hana::type_c<T>);
}
template<class... Ts, class T>
constexpr auto contains(T){
  return contains<T,Ts...>();
}
template<class... Ts, template<class...> class Outer, class T>
constexpr auto contains(Outer<T>){
  return contains<T,Ts...>();
}
I think this "could" work for most things
oops no, I don't trigger the recursion.
Jason Rice
@ricejasonf
Nov 26 2015 20:12
you could use std::forward_as_tuple maybe. here is my not so clean solution using a custom decay function
#include<boost/hana.hpp>
#include<vector>
#include<iostream>
#include<functional>

namespace hana = boost::hana;

template<typename T>
auto& decay_(T const& t)
{
  return t;
}
template<typename T>
T& decay_(std::reference_wrapper<T> t)
{
  return t.get();
}
template<typename T>
using decay = typename std::decay<decltype(decay_(std::declval<T>()))>::type;

template<class... Ts, class T>
constexpr auto contains(T){
  return hana::contains(hana::tuple_t<Ts...>, hana::type_c<decay<T>>);
}
int main()
{
  auto vtuple = hana::make_tuple(std::vector<int>{1,2,3}
                                ,std::vector<float>{1,2,3}
                                ,std::vector<double>{1,2,3});
  auto vt1 = hana::transform(vtuple, [](auto& v) {return std::ref(v);});

  auto c = [&](auto& t){return contains<std::vector<int>
                                       ,std::vector<float>>(t);};
  auto vt2= hana::filter(vt1, c);
  auto vt3 = hana::transform(vt2, [](auto&& t_){
      auto& t = decay_(t_);
      return hana::make_tuple(t.begin(), t.end());
  });
  auto vt4 = hana::transform(hana::filter(vt1, c), [](auto&& t_){
      auto& t = decay_(t_);
      return hana::make_tuple(t.begin(), t.end());
  });
  auto vt5 = vt3[hana::int_c<0>];
  auto vt6 = vt4[hana::int_c<0>];
  for(auto first = vt5[hana::int_c<0>], end = vt5[hana::int_c<1>]; first != end; ++first){
    std::cout << *first << std::endl;
  }
  for(auto first = vt6[hana::int_c<0>], end = vt6[hana::int_c<1>]; first != end; ++first){
    //stack corruption
    std::cout << *first << std::endl;
  }
}
so it basically just decays a reference wrapper to a reference without messing up non reference wrappers
i'm suprised there is no std::decay_wrapper :P
Louis Dionne
@ldionne
Nov 26 2015 21:59
I wouldn’t touch the contains function. Just use get() whenever you need it:
int main() {
  auto vtuple = hana::make_tuple(std::vector<int>{1,2,3}
                                ,std::vector<float>{1,2,3}
                                ,std::vector<double>{1,2,3});
  auto vt1 = hana::transform(vtuple, [](auto& v) {return std::ref(v); });

  auto c = [&](auto& t){
    return contains<std::vector<int>,std::vector<float>>(t.get());
  };

  auto vt2= hana::filter(vt1, c);
  auto vt3 = hana::transform(vt2, [](auto&& t){
      return hana::make_tuple(t.get().begin(), t.get().end());
  });
  auto vt4 = hana::transform(hana::filter(vt1, c), [](auto&& t){
      return hana::make_tuple(t.get().begin(), t.get().end());
  });
  auto vt5 = vt3[hana::int_c<0>];
  auto vt6 = vt4[hana::int_c<0>];
  for(auto first = vt5[hana::int_c<0>], end = vt5[hana::int_c<1>]; first != end; ++first){
    std::cout << *first << std::endl;
  }
  for(auto first = vt6[hana::int_c<0>], end = vt6[hana::int_c<1>]; first != end; ++first){
    //stack corruption
    std::cout << *first << std::endl;
  }
}
It’s really like you’re manipulating a tuple of pointers, doing things explicitly, but you use std::ref instead of pointers.
If you think of it, it’s also how you would have to do if that was a std::vector instead of a tuple, because STL containers can’t hold raw references.
Maik Klein
@MaikKlein
Nov 26 2015 22:06
not related to hana but is there a difference between vt4 and vt3 in performance? vt4 moves a tuple of references and vt3 takes a reference of a tuple of references
I don't ask this because I want to optimize, I just want to understand if there would be a difference.
Louis Dionne
@ldionne
Nov 26 2015 22:12
Under the hood, a reference is just a pointer. But moving or copying a pointer is just the same thing. Hence, it shouldn’t make any difference.
Of course, the language does not mandate anything w.r.t. codegen, so it’s all up to your optimizer.
I wouldn’t be surprised if the optimizer was even able to see through it all and directly reference the proper elements of vt1 when creating vt3 and vt4, without ever creating temporary references in between.
But I could be wrong.
Maik Klein
@MaikKlein
Nov 26 2015 22:16
Quote from the std "It is unspecified whether or not a reference requires storage (3.7)."
Btw I wanted to say thank you, you guys helped me a lot.
I am going to replace my own meta lib with hana now
Louis Dionne
@ldionne
Nov 26 2015 22:22

Quote from the std "It is unspecified whether or not a reference requires storage (3.7).”

But concretely, I would be surprised if it was anything else than a pointer.

Btw I wanted to say thank you, you guys helped me a lot.

No problem, it’s a pleasure!

I am going to replace my own meta lib with hana now

Let us know if you run into issues. Also, consider contributing if you find some aspects of the library that do not suit you. In some scenarios, the performance is suboptimal and we could improve it, it’s just a matter of working on it.

Maik Klein
@MaikKlein
Nov 26 2015 22:23
absolutely