template <class U> inline
void dispatch(const std::string& c, U& to, const codecvt_type& cvt)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::wstring& c, U& to, const codecvt_type& cvt)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::vector<char>& c, U& to, const codecvt_type& cvt)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::vector<wchar_t>& c, U& to, const codecvt_type& cvt)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
template <class U> inline
void dispatch(const std::string& c, U& to)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to);
}
template <class U> inline
void dispatch(const std::wstring& c, U& to)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to);
}
template <class U> inline
void dispatch(const std::vector<char>& c, U& to)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to);
}
template <class U> inline
void dispatch(const std::vector<wchar_t>& c, U& to)
{
- if (c.size())
+ if (!c.empty())
convert(&*c.begin(), &*c.begin() + c.size(), to);
}
typename boost::disable_if<boost::is_array<Container>, void>::type
dispatch(const Container & c, U& to, const codecvt_type& cvt)
{
- if (c.size())
+ if (!c.empty())
{
std::basic_string<typename Container::value_type> s(c.begin(), c.end());
convert(s.c_str(), s.c_str()+s.size(), to, cvt);
typename boost::disable_if<boost::is_array<Container>, void>::type
dispatch(const Container & c, U& to)
{
- if (c.size())
+ if (!c.empty())
{
std::basic_string<typename Container::value_type> seq(c.begin(), c.end());
convert(seq.c_str(), seq.c_str()+seq.size(), to);