TartanLlama / expected

C++11/14/17 std::expected with functional-style extensions

Home Page:https://tl.tartanllama.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is expected meant to be trivial if the template types are trivial?

jackgerrits opened this issue · comments

Is tl::expected meant to be trivial if both template types are trivial? The below snippet demonstrates this:

// Trivial
static_assert(std::is_trivial<VW::vw_error>::value, "");

// Not trivial
static_assert(!std::is_trivial<tl::expected<int, VW::vw_error>>::value, "");
static_assert(!std::is_trivial<tl::expected<void, VW::vw_error>>::value, "");

It seems this was a bad assumption on my part, I mistook all of the trivial checks in the implementation. It seems they are for the part of the paper that states trivial types are constepxr? http://www.open-std.org/jtc1/SC22/wg21/docs/papers/2018/p0323r7.html