Commit 8946c3b5 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Tweak deletion of fbstring::operator= taking convertible-to char

Summary: [Folly] Tweak deletion of `fbstring::operator=` taking convertible-to `char`.

Reviewed By: Orvid

Differential Revision: D13747744

fbshipit-source-id: f254f13a15cb0e72120d1d02f4c8893a788e429a
parent 5f99ab65
......@@ -1238,6 +1238,8 @@ class basic_fbstring {
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
......@@ -1251,11 +1253,16 @@ class basic_fbstring {
// look for basic_fbstring::basic_fbstring, which is just plain wrong.
template <typename TP>
typename std::enable_if<
std::is_same<
typename std::decay<TP>::type,
typename folly::basic_fbstring<E, T, A, Storage>::value_type>::value,
std::is_convertible<
TP,
typename folly::basic_fbstring<E, T, A, Storage>::value_type>::
value &&
!std::is_same<
typename std::decay<TP>::type,
typename folly::basic_fbstring<E, T, A, Storage>::value_type>::
value,
basic_fbstring<E, T, A, Storage>&>::type
operator=(TP c);
operator=(TP c) = delete;
basic_fbstring& operator=(std::initializer_list<value_type> il) {
return assign(il.begin(), il.end());
......@@ -1911,13 +1918,8 @@ inline basic_fbstring<E, T, A, S>& basic_fbstring<E, T, A, S>::operator=(
}
template <typename E, class T, class A, class S>
template <typename TP>
inline typename std::enable_if<
std::is_same<
typename std::decay<TP>::type,
typename folly::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) {
inline basic_fbstring<E, T, A, S>& basic_fbstring<E, T, A, S>::operator=(
value_type c) {
Invariant checker(*this);
if (empty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment