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 15:06

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 24 07:47

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

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

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

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

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 02 00:33
    ricejasonf closed #434
  • Jan 02 00:33
    ricejasonf commented #434
  • Jan 02 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
Andreas Pokorny
@APokorny
so it seems that I could hook into the tag dispatching of hana and use the algorithms then
but I have to implement a lot of them myself for that.. hmm maybe I should just use hana tuple instead
Jason Rice
@ricejasonf
It's not that hard. I even implemented hana::Sequence, but it has the precondition that the types be stateless and default constructible (ie empty)
Andreas Pokorny
@APokorny
what was your motivation to implement a hana concept?
Jason Rice
@ricejasonf
I was already using Hana and needed a way to transform types. In general, implementing its concepts is very useful for generic programming.
... and you get a lot of algorithms for free.
Andreas Pokorny
@APokorny
i mean .. why not stick with tuple?
Jason Rice
@ricejasonf
Pure type programming is a bit faster at compile-time
It gets better and better as the compilers get faster, but hana::tuple has to manage the run-time state of objects which adds to the build time.
That's why I've been refactoring my "empty" stuff to use mp11 because the algorithms don't worry about run-time state either.
Andreas Pokorny
@APokorny
oh nice benchmark then I will continue on that path
Jason Rice
@ricejasonf
Jason Rice
@ricejasonf
@ldionne Has anyone explored the idea of a weak function alias in C++?
Jason Rice
@ricejasonf
err "callable" alias
invocation alias :P
Alastair Rankine
@randomphrase
@ricejasonf what do you mean by that?
Jason Rice
@ricejasonf
So.. in TMP they use type aliases to get cheap transformations without creating an intermediate type...
If the same could be done with a function invocation that could eliminate a lot of unnecessary stuff like forwarding, noexcept correctness propagation, a function call.
Jason Rice
@ricejasonf
@ldionne test.headers.boost.hana.detail.ebo doesn't have a main function when I run make check. I did alter CMakeLists.txt to only require cmake v3.7. (not sure if that could cause it)
also... "invocation alias" ;) ;)
Jason Rice
@ricejasonf
constexpr auto tag = hana::typeid_([]{});
Gleb Popov
@arrowd

Hello. I'm using hana::transform on a hana::tuple to deserialize args pack using boost serialization:

    boost::hana::basic_tuple<Args...> t;

    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
        t = boost::hana::transform(t, [&](auto e) {
            ar >> e;
            return e;
        });
    }

This works, but in reversed order. That is, if my Args are, say, 1, 2, 3, they get deserialized into 3,2,1. Is it a bug, or I'm using tranform in a wrong way?

Alastair Rankine
@randomphrase
What are you actually transforming here? Seems like no transformation is taking place, but the serialization is a side effect?
Maybe you want for_each, or possibly fold(t, ar, [] (auto& ar, auto& el) { return ar >> el; });
Gleb Popov
@arrowd
@randomphrase Whoa, I completely missed that I can change lambda's argument to auto&. With that, for_each indeed does the job. Awesome, thanks.
Andreas Pokorny
@APokorny
hm what are common limits for number of template parameters?
lets say I want to create a integral matrix constant
Jason Rice
@ricejasonf
I'm not aware of any limits, but if you are working with integrals then an array would be much faster.
@APokorny ^
Andreas Pokorny
@APokorny
back at the graph algorithms .. thought about building an adjacency matrix
Jason Rice
@ricejasonf
for a game or something?
Andreas Pokorny
@APokorny
for a not that micro micro controller
we do push dedicated firmwares on each device... 4mb rom and ~ 512kb ram
seertaak
@seertaak
Hello
Is anyone there?
Jason Rice
@ricejasonf
yo
Jason Rice
@ricejasonf
It looks like Brigand is doing the types as values thing: https://github.com/edouarda/brigand/wiki/Runtime
Andreas Pokorny
@APokorny
I am currently using kvasir mpl
Jason Rice
@ricejasonf
I use mp11 for some stuff
Hunber
@a33445321
hello, If i want write a logger to database through boost-log , how should i do?
thanks a lot
Jason Rice
@ricejasonf
@a33445321 Perhaps ask this on the Boost mailing list. This is the chat for the Boost.Hana metaprogramming library.
Hunber
@a33445321
@ricejasonf Thank you
Andreas Pokorny
@APokorny
so a do notation..
Jason Rice
@ricejasonf
I just encountered a scenario where not having typename changed caused sfinae to squelch an error.
#include <boost/hana.hpp>
#include <array>
#include <string>
#include <type_traits>

namespace hana = boost::hana;

int main() {
  auto is_byte_container = hana::is_valid([](auto&& x)
    -> std::enable_if_t<(sizeof(typename std::decay_t<decltype(x)>::value_type) == 1)>
                             // ^ don't forget typename or its not valid
  { return {}; });

  static_assert(decltype(is_byte_container(std::string{})){});
  static_assert(decltype(is_byte_container(std::array<unsigned char, 42>{})){});
}
everything was fine, but the static_asserts were failing
something about sizeof, but I don't get it
Jason Rice
@ricejasonf
I mention Boost.Hana a few times here http://cppcast.com/2018/04/jason-rice/ (shameless plug)
Darth Rubik
@DarthRubik
Foolish question: Why is there not a concept for things that have the set operations (like union_, intersection, and symmetric_difference)? Or am I just not looking hard enough in the docs and code?
Jason Rice
@ricejasonf
boostorg/hana#367