mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 13:25:41 +02:00
Move Approx out of the Detail namespace
This commit is contained in:
@@ -60,6 +60,4 @@
|
||||
|
||||
#include <catch2/catch_reenable_warnings.h>
|
||||
|
||||
using Catch::Detail::Approx;
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||
|
@@ -23,7 +23,6 @@ bool marginComparison(double lhs, double rhs, double margin) {
|
||||
}
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
|
||||
Approx::Approx ( double value )
|
||||
: m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
|
||||
@@ -70,18 +69,16 @@ namespace Detail {
|
||||
m_epsilon = newEpsilon;
|
||||
}
|
||||
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val) {
|
||||
return Detail::Approx(val);
|
||||
Approx operator "" _a(long double val) {
|
||||
return Approx(val);
|
||||
}
|
||||
Detail::Approx operator "" _a(unsigned long long val) {
|
||||
return Detail::Approx(val);
|
||||
Approx operator "" _a(unsigned long long val) {
|
||||
return Approx(val);
|
||||
}
|
||||
} // end namespace literals
|
||||
|
||||
std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx const& value) {
|
||||
std::string StringMaker<Catch::Approx>::convert(Catch::Approx const& value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace Catch {
|
||||
namespace Detail {
|
||||
|
||||
class Approx {
|
||||
private:
|
||||
@@ -115,16 +114,15 @@ namespace Detail {
|
||||
double m_scale;
|
||||
double m_value;
|
||||
};
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val);
|
||||
Detail::Approx operator "" _a(unsigned long long val);
|
||||
Approx operator "" _a(long double val);
|
||||
Approx operator "" _a(unsigned long long val);
|
||||
} // end namespace literals
|
||||
|
||||
template<>
|
||||
struct StringMaker<Catch::Detail::Approx> {
|
||||
static std::string convert(Catch::Detail::Approx const& value);
|
||||
struct StringMaker<Catch::Approx> {
|
||||
static std::string convert(Catch::Approx const& value);
|
||||
};
|
||||
|
||||
} // end namespace Catch
|
||||
|
@@ -124,7 +124,7 @@ namespace Matchers {
|
||||
}
|
||||
|
||||
std::vector<T> const& m_comparator;
|
||||
mutable Catch::Detail::Approx approx = Catch::Detail::Approx::custom();
|
||||
mutable Catch::Approx approx = Catch::Approx::custom();
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
Reference in New Issue
Block a user