Move init out of class defn.
This commit is contained in:
parent
0b53feb413
commit
bbc3b99b31
27
fmt/format.h
27
fmt/format.h
@ -1937,7 +1937,21 @@ class ArgMap {
|
|||||||
MapType map_;
|
MapType map_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FMT_API void init(const ArgList &args) {
|
void init(const ArgList &args);
|
||||||
|
|
||||||
|
const internal::Arg *find(const fmt::BasicStringRef<Char> &name) const {
|
||||||
|
// The list is unsorted, so just return the first matching name.
|
||||||
|
for (typename MapType::const_iterator it = map_.begin(), end = map_.end();
|
||||||
|
it != end; ++it) {
|
||||||
|
if (it->first == name)
|
||||||
|
return &it->second;
|
||||||
|
}
|
||||||
|
return FMT_NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename Char>
|
||||||
|
void ArgMap<Char>::init(const ArgList &args) {
|
||||||
if (!map_.empty())
|
if (!map_.empty())
|
||||||
return;
|
return;
|
||||||
typedef internal::NamedArg<Char> NamedArg;
|
typedef internal::NamedArg<Char> NamedArg;
|
||||||
@ -1981,17 +1995,6 @@ class ArgMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const internal::Arg *find(const fmt::BasicStringRef<Char> &name) const {
|
|
||||||
// The list is unsorted, so just return the first matching name.
|
|
||||||
for (typename MapType::const_iterator it = map_.begin(), end = map_.end();
|
|
||||||
it != end; ++it) {
|
|
||||||
if (it->first == name)
|
|
||||||
return &it->second;
|
|
||||||
}
|
|
||||||
return FMT_NULL;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Impl, typename Char, typename Spec = fmt::FormatSpec>
|
template <typename Impl, typename Char, typename Spec = fmt::FormatSpec>
|
||||||
class ArgFormatterBase : public ArgVisitor<Impl, void> {
|
class ArgFormatterBase : public ArgVisitor<Impl, void> {
|
||||||
private:
|
private:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user