mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-07 07:51:00 +00:00
Reinline some StringMaker impls
This commit is contained in:
parent
b93cf932fb
commit
cb25c4a8a3
2 changed files with 14 additions and 21 deletions
|
@ -239,7 +239,10 @@ namespace Catch {
|
|||
|
||||
template<>
|
||||
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<>
|
||||
|
@ -257,7 +260,10 @@ namespace Catch {
|
|||
|
||||
template<>
|
||||
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<>
|
||||
|
@ -512,18 +518,14 @@ namespace Catch {
|
|||
|
||||
template <class Ratio>
|
||||
struct ratio_string {
|
||||
static std::string symbol();
|
||||
static std::string symbol() {
|
||||
Catch::ReusableStringStream rss;
|
||||
rss << '[' << Ratio::num << '/'
|
||||
<< Ratio::den << ']';
|
||||
return rss.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <class Ratio>
|
||||
std::string ratio_string<Ratio>::symbol() {
|
||||
Catch::ReusableStringStream rss;
|
||||
rss << '[' << Ratio::num << '/'
|
||||
<< Ratio::den << ']';
|
||||
return rss.str();
|
||||
}
|
||||
|
||||
|
||||
template <>
|
||||
struct ratio_string<std::atto> {
|
||||
static std::string symbol() { return "a"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue