flatten 20260225

This commit is contained in:
Timothy Prepscius
2026-02-25 12:43:06 -05:00
commit 996151a56a
521 changed files with 46722 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// License: Modified MIT (NON-AI)
// See the LICENSE file in the root directory for license information.
// Copyright 2025 Timothy Prepscius
#include <tjp/core/testing/catch.hpp>
#include <tjp/core/sfinae/if_or.hpp>
#include <type_traits>
namespace tjp::core::sfinae {
namespace {
SCENARIO("core::sfinae::if_or")
{
static_assert(
std::is_same_v<if_or<true, int, float>::type, int>
);
static_assert(
std::is_same_v<if_or<false, int, float>::type, float>
);
}
} // namespace
} // namespace

20
tjp/core/sfinae/if_or.hpp Normal file
View File

@@ -0,0 +1,20 @@
// License: Modified MIT (NON-AI)
// See the LICENSE file in the root directory for license information.
// Copyright 2025 Timothy Prepscius
#pragma once
namespace tjp {
namespace core {
namespace sfinae {
template<bool B, class T = void, class U = void>
struct if_or { typedef U type; };
template<class T, class U>
struct if_or <true, T, U> { typedef T type; };
} // namespace
} // namespace
} // namespace