From 6c45f572cbd8326b32ca17e4ada6b404ed6e3d10 Mon Sep 17 00:00:00 2001 From: lukas <89145039+codethinki@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:15:31 +0200 Subject: [PATCH] feat(meta): trivially_copyable concept std has the trait only, CPT() and range_over_cpt need a concept: range_over_cpt. --- cth/incl/cth/meta/concepts.hpp | 3 +++ cth/tests/src/meta/concepts_test.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/cth/incl/cth/meta/concepts.hpp b/cth/incl/cth/meta/concepts.hpp index 8463f40..cbceed7 100644 --- a/cth/incl/cth/meta/concepts.hpp +++ b/cth/incl/cth/meta/concepts.hpp @@ -92,6 +92,9 @@ concept decayed = std::same_as, T>; template concept trivial = std::is_trivial_v; +template +concept trivially_copyable = std::is_trivially_copyable_v; + template concept reference = std::is_reference_v; diff --git a/cth/tests/src/meta/concepts_test.cpp b/cth/tests/src/meta/concepts_test.cpp index 481ee7f..df6282a 100644 --- a/cth/tests/src/meta/concepts_test.cpp +++ b/cth/tests/src/meta/concepts_test.cpp @@ -15,6 +15,17 @@ TYPE_TEST(all_satisfy, main) { ASSERT_FALSE((all_satisfy) ); } +TYPE_TEST(trivially_copyable, main) { + struct Point { + float x, y; + }; + + ASSERT_TRUE((trivially_copyable) ); + ASSERT_TRUE((trivially_copyable) ); + ASSERT_FALSE((trivially_copyable) ); + ASSERT_TRUE((satisfies) ); +} + TYPE_TEST(any_satisfy, main) { ASSERT_TRUE((any_satisfy) ); ASSERT_TRUE((any_satisfy) );