45 lines
560 B
C++
45 lines
560 B
C++
//
|
|
// MathIO.h
|
|
// common
|
|
//
|
|
// Created by Timothy Prepscius on 8/4/18.
|
|
// Copyright © 2018 Timothy Prepscius. All rights reserved.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "Real.h"
|
|
|
|
#include "Accuracy+IO.h"
|
|
|
|
namespace tjp {
|
|
namespace core {
|
|
namespace math {
|
|
|
|
template<typename V, Real M>
|
|
struct Precision
|
|
{
|
|
V v;
|
|
|
|
operator V&()
|
|
{
|
|
return *this;
|
|
}
|
|
|
|
operator const V&() const
|
|
{
|
|
return *this;
|
|
}
|
|
} ;
|
|
|
|
template<typename IO, typename T, Real M>
|
|
void io_ (IO &io, Precision<T, M> &v)
|
|
{
|
|
io.any(with_accuracy(v, M));
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace
|
|
} // namespace
|
|
|