mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Reinline some StringMaker impls
This commit is contained in:
parent
b93cf932fb
commit
cb25c4a8a3
@ -201,11 +201,6 @@ std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
|
|||||||
return rss.str();
|
return rss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string StringMaker<bool>::convert(bool b) {
|
|
||||||
return b ? "true" : "false";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringMaker<signed char>::convert(signed char value) {
|
std::string StringMaker<signed char>::convert(signed char value) {
|
||||||
if (value == '\r') {
|
if (value == '\r') {
|
||||||
return "'\\r'";
|
return "'\\r'";
|
||||||
@ -230,10 +225,6 @@ std::string StringMaker<unsigned char>::convert(unsigned char c) {
|
|||||||
return ::Catch::Detail::stringify(static_cast<char>(c));
|
return ::Catch::Detail::stringify(static_cast<char>(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StringMaker<std::nullptr_t>::convert(std::nullptr_t) {
|
|
||||||
return "nullptr";
|
|
||||||
}
|
|
||||||
|
|
||||||
int StringMaker<float>::precision = 5;
|
int StringMaker<float>::precision = 5;
|
||||||
|
|
||||||
std::string StringMaker<float>::convert(float value) {
|
std::string StringMaker<float>::convert(float value) {
|
||||||
|
@ -239,7 +239,10 @@ namespace Catch {
|
|||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct StringMaker<bool> {
|
struct StringMaker<bool> {
|
||||||
static std::string convert(bool b);
|
static std::string convert(bool b) {
|
||||||
|
using namespace std::string_literals;
|
||||||
|
return b ? "true"s : "false"s;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
@ -257,7 +260,10 @@ namespace Catch {
|
|||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct StringMaker<std::nullptr_t> {
|
struct StringMaker<std::nullptr_t> {
|
||||||
static std::string convert(std::nullptr_t);
|
static std::string convert(std::nullptr_t) {
|
||||||
|
using namespace std::string_literals;
|
||||||
|
return "nullptr"s;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
@ -512,17 +518,13 @@ namespace Catch {
|
|||||||
|
|
||||||
template <class Ratio>
|
template <class Ratio>
|
||||||
struct ratio_string {
|
struct ratio_string {
|
||||||
static std::string symbol();
|
static std::string symbol() {
|
||||||
};
|
|
||||||
|
|
||||||
template <class Ratio>
|
|
||||||
std::string ratio_string<Ratio>::symbol() {
|
|
||||||
Catch::ReusableStringStream rss;
|
Catch::ReusableStringStream rss;
|
||||||
rss << '[' << Ratio::num << '/'
|
rss << '[' << Ratio::num << '/'
|
||||||
<< Ratio::den << ']';
|
<< Ratio::den << ']';
|
||||||
return rss.str();
|
return rss.str();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ratio_string<std::atto> {
|
struct ratio_string<std::atto> {
|
||||||
|
Loading…
Reference in New Issue
Block a user