Skip to content

Commit

Permalink
[FOLD] test static_string as NTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed Jan 10, 2024
1 parent 6b21195 commit 1377ed8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/constexpr_tests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,5 +605,28 @@ testConstantEvaluation()
cstatic_string().empty();
#endif
}

#ifdef BOOST_STATIC_STRING_CPP20

template<static_string<32> X>
struct nttp_primary
{
static constexpr bool value = false;
};

template<>
struct nttp_primary<"test string">
{
static constexpr bool value = true;
};

static_assert(!nttp_primary<"random string">::value,
"structural equality broken");

static_assert(nttp_primary<"test string">::value,
"structural equality broken");

#endif

} // static_strings
} // boost

0 comments on commit 1377ed8

Please sign in to comment.