On 16 September 2016 at 15:23, Andrzej Krzemienski
Hi Everyone, I would like to ask your opinion, suggestions, and perhaps an informal review of the 'markable' library. An alternative to boost::optional when performance really matters. It is the second incarnation of the 'compact_optional' library that I have presented last year.
The main differences from the previous version: * name change: it is called 'markable' so that it is not confused with 'optional'. It uses "mark values" and mark policies" * it has the ability to mark an empty state even for the types with strong invariants, by marking a bit pattern rather than any proper value of T (an idea by Matt Calabrese)
An example use case:
typedef markable
> opt_int; opt_int oi; opt_int o2 (2); assert (!oi.has_value());assert (o2.has_value());assert (o2.value() == 2); static_assert (sizeof(opt_int) == sizeof(int), "");
The github repository: https://github.com/akrzemi1/markable And documentation therein: https://github.com/akrzemi1/markable/tree/master/documentation
Any comments, suggestions or critique are most welcome.
Regards, &rzej;
I am interested in doing a quick review of this library, but I have first to ask why "markable"? I'm not sure I understand the intended meaning of this word in this context. Joël Lamotte