Move init out of class defn.
This commit is contained in:
parent
0b53feb413
commit
bbc3b99b31
29
fmt/format.h
29
fmt/format.h
@ -1937,7 +1937,21 @@ class ArgMap {
|
||||
MapType map_;
|
||||
|
||||
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())
|
||||
return;
|
||||
typedef internal::NamedArg<Char> NamedArg;
|
||||
@ -1979,18 +1993,7 @@ class ArgMap {
|
||||
/*nothing*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
class ArgFormatterBase : public ArgVisitor<Impl, void> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user