mirror of
https://github.com/NixOS/nix
synced 2025-06-29 23:13:14 +02:00
Remove FormatOrString and remaining uses of format()
This commit is contained in:
parent
b9370fd7a0
commit
29abc8e764
40 changed files with 102 additions and 125 deletions
|
@ -17,16 +17,6 @@ using boost::format;
|
|||
struct nop { template<typename... T> nop(T...) {} };
|
||||
|
||||
|
||||
struct FormatOrString
|
||||
{
|
||||
std::string s;
|
||||
FormatOrString(std::string s) : s(std::move(s)) { };
|
||||
template<class F>
|
||||
FormatOrString(const F & f) : s(f.str()) { };
|
||||
FormatOrString(const char * s) : s(s) { };
|
||||
};
|
||||
|
||||
|
||||
/* A helper for formatting strings. ‘fmt(format, a_0, ..., a_n)’ is
|
||||
equivalent to ‘boost::format(format) % a_0 % ... %
|
||||
... a_n’. However, ‘fmt(s)’ is equivalent to ‘s’ (so no %-expansion
|
||||
|
@ -53,11 +43,6 @@ inline std::string fmt(const char * s)
|
|||
return s;
|
||||
}
|
||||
|
||||
inline std::string fmt(const FormatOrString & fs)
|
||||
{
|
||||
return fs.s;
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
inline std::string fmt(const std::string & fs, const Args & ... args)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue