26 lines
521 B
C++
26 lines
521 B
C++
// 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
|