return assign(s);
}
- basic_fbstring& operator=(value_type c);
+ // This actually goes directly against the C++ spec, but the
+ // value_type overload is dangerous, so we're explicitly deleting
+ // any overloads of operator= that could implicitly convert to
+ // value_type.
+ template <typename TP>
+ typename std::enable_if<
+ std::is_same<typename std::decay<TP>::type, value_type>::value,
+ basic_fbstring&>::type
+ operator=(TP c);
basic_fbstring& operator=(std::initializer_list<value_type> il) {
return assign(il.begin(), il.end());
}
template <typename E, class T, class A, class S>
-inline basic_fbstring<E, T, A, S>& basic_fbstring<E, T, A, S>::operator=(
- const value_type c) {
+template <typename TP>
+inline typename std::enable_if<
+ std::is_same<
+ typename std::decay<TP>::type,
+ typename basic_fbstring<E, T, A, S>::value_type>::value,
+ basic_fbstring<E, T, A, S>&>::type
+basic_fbstring<E, T, A, S>::operator=(TP c) {
Invariant checker(*this);
if (empty()) {
}
template <class String> void clause11_21_4_2_m(String & test) {
// Assignment from char
- test = random('a', 'z');
+ using value_type = typename String::value_type;
+ test = random(static_cast<value_type>('a'), static_cast<value_type>('z'));
}
template <class String> void clause11_21_4_2_n(String & test) {
// Assignment from initializer_list<char>