flatten 20260225
This commit is contained in:
25
tjp/core/io/OptionalIO.h
Normal file
25
tjp/core/io/OptionalIO.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// License: Modified MIT (NON-AI)
|
||||
// See the LICENSE file in the root directory for license information.
|
||||
// Copyright 2025 Timothy Prepscius
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace tjp::core::io {
|
||||
|
||||
template<typename T>
|
||||
struct OptionalIO
|
||||
{
|
||||
T &v;
|
||||
bool write;
|
||||
} ;
|
||||
|
||||
template<typename T>
|
||||
OptionalIO<T> optional(T &t, bool write=true) { return OptionalIO<T> { t, write }; }
|
||||
|
||||
template<typename IO, typename T>
|
||||
void io_(IO &io, OptionalIO<T> &t)
|
||||
{
|
||||
static_assert(always_false<T>::value, "this should not be dispatched to");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user