profile
viewpoint

akrzemi1/Optional 298

optional (nullable) objects for C++14

akrzemi1/explicit 183

A set of small tools that allow you to state your intentions mre explicitly in the code

akrzemi1/markable 68

A template for creating optional-like objects with no space overhead

akrzemi1/compact_optional 23

A template for creating optional-like object with no space overhead

akrzemi1/out_param 4

A template for declaring function's output parameters

akrzemi1/concepts-ts 2

Technical Specification: Concepts

akrzemi1/Beast 1

HTTP and WebSocket built on Boost.Asio in C++11

akrzemi1/boost 1

Super-project for modularized Boost

akrzemi1/contract 1

A paper on contract programming in C++

push eventakrzemi1/markable

Andrzej Krzemieński

commit sha dfe2a9008ac042ae81e89f75c01a3b974b5b0b43

fix message in static_assert

view details

push time in 11 days

issue commentboostorg/optional

Why is the ctor of optional<T&> explicit?

Would allowing a conversion from T to const T address your issue? Or conversion from Derived& to Base&?

ImplOfAnImpl

comment created time in 12 days

issue commentboostorg/optional

Why is the ctor of optional<T&> explicit?

Unless the binding of temporaries to lvalue references to const is explicitly disabled. Even the reference casts have the same problems:

  int i = -1;
  unsigned const& ui = i;

Consistency with std::optional is not necessarily a good thing, as std::optional has design flaws that cause ambiguities:

template <typename T, typename U>
void test_optional()
{
  std::optional<U> ou = std::nullopt;
  std::optional<T> ot = ou;
  assert (ot == std::nullopt); // true for some Ts and Us, false for other Ts and Us.
}

The above looks like an obvious thing to expect, but fails for

test_optional<std::optional<int>, int>();

boost::optional has fewer gotchas like the one above, because it does not try to be 100% consistent with std::optional.

ImplOfAnImpl

comment created time in 12 days

issue commentboostorg/optional

Why is the ctor of optional<T&> explicit?

This is for consistency with the non-reference specialization: optional<U> is not implicitly convertible to optional<T> even if U is convertible to T.

The missing T-to-const T can indeed be disturbing. This is also the case for non-references:

boost::optional<int> oi;
boost::optional<const int> oci = oi;

We could consider special casing the T-to-const T conversion.

ImplOfAnImpl

comment created time in 12 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha 81a362f94a6027d2f45b732d0804ecef47c1a84c

Demonstrate the markable bool

view details

push time in 16 days

issue commentboostorg/optional

Interoperability with std::optional<bool>

Should be fixed in develop branch.

pfee

comment created time in 16 days

push eventboostorg/optional

Andrzej Krzemienski

commit sha 7dd512a0196205f45a481bbbc302f8bf4d92626e

Fix issue #98

view details

push time in 16 days

issue commentboostorg/optional

Interoperability with std::optional<bool>

It delegates to boost::is_constructible: https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L803 It should delegate to boost::is_convertible instead.

pfee

comment created time in 17 days

issue commentboostorg/optional

Interoperability with std::optional<bool>

Thank you for the report. It looks like type trait is_optional_val_init_candidate does not work correctly. Le me investigate.

pfee

comment created time in 17 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha c008b303e2440a7ef468187b85871f9ee105d5b5

fix docs link

view details

push time in 17 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha 13d29e6508043c6db4427bae2babed0f840eee49

Add "how do I do X"

view details

push time in 17 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha 97ab928a92b4d979afe2622d39a7d8342c158ac9

link to overview from README

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha ce4ebc66510457b312f1dccf3528b48c976819e5

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha e6028b6cb426e2b58ae71bdaeeba3523f19586cb

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha e2a93fef5ca75ebe1f152c4a94ce2d46a28afd62

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 0a0df89ad73d30a071e961d546864311688cb675

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 1d3370f163020753f13179fd2527550d178f6f98

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha a4f912548d5851950966236eb730254e4ea2d047

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 14876326e87e3d83640417ce0426a15a7e5ff15d

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha c761fdbbac4a17e40979c5bc30937beafc731ee8

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 6428e411848d281c0360112cb9cc586be9a7d26f

Update contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 4155ae943c4ebd0535a12b7336e6fb23a5bf1010

Create contracts_design.md

view details

push time in 18 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha 461ffdc50a46b7d09390a85a08f7f5bb3e29a51d

Update contracts_model.md

view details

push time in 19 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha b3f9f19d75497575433efceb59ab442fe4a5dcd1

Delete contracts_notes.md

view details

push time in 20 days

push eventakrzemi1/papers

Andrzej Krzemieński

commit sha e47af8407c234515aed2d0139ec6b1cdc8d7e5ef

Update contracts_notes.md

view details

push time in 20 days

issue openedatomgalaxy/wg21-abort-only-contract-support

Describe the impact on the standard library

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf

created time in 20 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha 6d259cd2d2c48455fbe68e7745cd71b365f0c338

add named comparisons

view details

Andrzej Krzemienski

commit sha f62752db605e981e4aa2b6d0a9b0d4171b539b0f

document ordering function objects

view details

push time in 20 days

push eventakrzemi1/markable

Andrzej Krzemienski

commit sha f62752db605e981e4aa2b6d0a9b0d4171b539b0f

document ordering function objects

view details

push time in 20 days

push eventatomgalaxy/wg21-abort-only-contract-support

Andrzej Krzemieński

commit sha 410ac8f2a2aec48e76c5ea445105eae7c302a21c

HTML: updated document revisions

view details

push time in 21 days

push eventatomgalaxy/wg21-abort-only-contract-support

Andrzej Krzemieński

commit sha 69928a3905dfead1935a94629a743f800b1920ac

HTML: D -> P

view details

push time in 21 days

more