Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 15:06

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 24 2019 07:47

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 23 2019 02:04
    pthom commented #432
  • Jan 18 2019 12:46

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 16 2019 22:27
    ricejasonf commented #434
  • Jan 05 2019 06:22
    ricejasonf commented #330
  • Jan 03 2019 11:40

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 02 2019 00:33
    ricejasonf closed #434
  • Jan 02 2019 00:33
    ricejasonf commented #434
  • Jan 02 2019 00:04
    ricejasonf opened #434
  • Dec 27 2018 13:11

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Dec 22 2018 11:56
    pthom commented #432
  • Dec 22 2018 11:55
    pthom commented #432
  • Dec 21 2018 15:48
    pthom synchronize #432
  • Dec 21 2018 09:19
    sdebionne opened #433
  • Dec 21 2018 00:08
    ricejasonf commented #432
  • Dec 21 2018 00:03
    ricejasonf commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:13
    ricejasonf commented #432
Jason Rice
@ricejasonf
it is encoded in the variable's type. you are already getting it mp_at_c<decltype(member_name_var)>
your call to std::get isn't needed
in that line
nor should you need to "remove reference"
err the "remove reference" comment I was looking at the old code in the chat
hana::at_key(result, MemberName{})
Hoss Ajallooiean
@katetsu
i tried that
but still geetting errors
auto& member = boost::hana::at_key(result, mp_at_c<decltype(member_name_var), I>);
I being the index
Jason Rice
@ricejasonf
break that line up
using MemberName = the error will be more obvious
you are passing a type where an expression is expected
Hoss Ajallooiean
@katetsu
exactly
Jason Rice
@ricejasonf
hence MemberName{} <- note the default construction
Hoss Ajallooiean
@katetsu
i see
ok so the default ctor creates the compile time string value?
vs the type is compile type hana string?
Jason Rice
@ricejasonf
same as decltype("timer"_s){}
or hana::string<'t', 'i', 'm', 'e', 'r'>{}
Hoss Ajallooiean
@katetsu
ok got it thanks a lot:)
Hoss Ajallooiean
@katetsu
hi @ricejasonf, do you have any idea what this compiler error means? https://godbolt.org/z/f1MPT3
Jason Rice
@ricejasonf
the key is not in the map
when calling at_key
internally it uses find which returns an optional hence the weird error
the key you are passing it my::not_found
Jason Rice
@ricejasonf
since you are not using I for anything other than getting the value inside the variant...
why not just use std::visit
you could use hana::overload_linearly and give a lambda that takes a my::not_found as its parameter and then a generic lambda that handles the compile-time string
Hoss Ajallooiean
@katetsu
Thanks a lot.
Adam Boseley
@aboseley
Is it possible to extract the types from a std::variant?
https://godbolt.org/z/oddP5T94G
Adam Boseley
@aboseley
This looks to work. Is there a better way
template <typename... Types> 
constexpr auto getVariantTypes(std::variant<Types...>&& v){
  return hana::tuple_t<Types...>;
}
Jason Rice
@ricejasonf
There's also Boost.Mp11 mp_rename<Var, hana::tuple>. It depends on what you want to do with the types.
Adam Boseley
@aboseley
I'd like to extract the types out of a std::variant, and put then the equivalent of a hana type list. The mp_rename shuffles the types from the variant to a hana::tuple, but I think I still need to wrap them in a hana::type_c. Which I struggling to do. This is easy to do for boost::variant but there isn't matching support for std::variant that I can see
Jason Rice
@ricejasonf
I suggest not using tuple_t. hana::experimental::types does the same thing without wrapping individuals types in type as that tends to create a lot of unnecessary type instantiations. If all you are doing is type computations then you don't want to use hana::tuple either as that has several member templates that are expensive to instantiate (relatively).
If you really wanted to you could do mp_transform<hana::type, mp_rename<Var, hana::tuple>>>
Adam Boseley
@aboseley
Thanks for the advise!
Adam Boseley
@aboseley
When introspecting on user defined types, is there a way to get back the string "name" of the struct, we pass in as the first to parameter to BOOST_HANA_ADAPT_STRUCT, like we do for each of its members?
Jason Rice
@ricejasonf
no, I think you would have to roll your own macro for that
...or just adding a static-constexpr char const* name manually
Adam Boseley
@aboseley
Thanks again. I've actually been adding a static-constexpr string_view to the parent structure to hold the name. It just duplicates what I'm already passing to the macro, and wanted to make sure I wasn't missing so other hana magic for getting it back.
Enrico Maria De Angelis
@Aster89
Gleb Popov
@arrowd
Just wanted to share your question here, but you already did that.
Enrico Maria De Angelis
@Aster89
@arrowd , my question? :D
Gleb Popov
@arrowd
Yep.
Enrico Maria De Angelis
@Aster89
Good, if I'm lucky someone will offer a bounty on it :D
Enrico Maria De Angelis
@Aster89
@arrowd , I've added a few more bits to the story too
It'd be nice to have Louis Dionne's opinion on it :D