On Sunday, 5 February 2017 21:30:15 UTC+2,
woodb...@gmail.com wrote:
> On Thursday, February 2, 2017 at 7:43:46 AM UTC-6, Öö Tiib wrote:
> > On Thursday, 2 February 2017 03:31:01 UTC+2, karolak kolo wrote:
> > > I didn't know that exists, but still what would be the use of this?
> >
> > Please quote to what you are answering, otherwise it is
> > unclear what you mean by "that" or "this" above. I assume you
> > mean 'std::variant', but if I'm wrong then discard the rest
> > of this letter.
> >
> > The 'std::variant' will be added to C++ standard library this
> > year
>
> Howard Hinnant predicted on an episode of Cppchat
>
>
http://www.slashslash.info/cppchat/
>
> that the latest version of the standard would be passed on
> December 31, 2017 at 10pm (if I remember correctly).
>
> Better late than never ...
Even if the standard will be signed 2018 the implementations
of std::variant were already useful 2016.
>
>
> >and it is basically type safe union (never empty and no
> > type punning possible):
> >
http://en.cppreference.com/w/cpp/utility/variant
> >
> > Requirements of it are widely based on implementation of
> > 'boost::variant' (that has been around for more than decade):
> >
http://www.boost.org/doc/libs/1_63_0/doc/html/variant.html
> >
> > If custom class does not offer something special then most
> > good programmers prefer standard library classes. It is so
> > because standard library classes are generally more efficient,
> > flexible, available for more platforms, better tested and/or
> > faster fixed than custom classes.
> >
>
> I think implementation-wise Clang shuns standard containers.
Few years ago when I tried to compile LLVM on microsoft
compiler then it contained lot of C that did not compile on
microsoft compiler. Source of LLVM smelled like another
tool of negotiations between apple and ms. That is most
awful code smell.
> I try to avoid them also, but I'm not successful yet in avoiding std::queue/std::deque.
We discussed those queues. I suggested to check performance
of boost::circular_buffer_space_optimized. You answered
that it is not portable enough for you. :D If you can't improve
such (quite portable, well-tested, open-source) container then
you can't likely make better one either. So you should use
standard containers (as maximally portable).