Commit f6f9d7ea authored by Aaryaman Sagar's avatar Aaryaman Sagar Committed by Facebook Github Bot

Leftover occurences of integral_constant<bool, ...>

Summary: title

Reviewed By: yfeldblum

Differential Revision: D8631916

fbshipit-source-id: be4ef689b9c2b0dcdd92f8ea61787f70f9a71f9c
parent 27929e3d
...@@ -1351,11 +1351,9 @@ inline std::string errorValue(const Src& value) { ...@@ -1351,11 +1351,9 @@ inline std::string errorValue(const Src& value) {
} }
template <typename Tgt, typename Src> template <typename Tgt, typename Src>
using IsArithToArith = std::integral_constant< using IsArithToArith = bool_constant<
bool,
!std::is_same<Tgt, Src>::value && !std::is_same<Tgt, bool>::value && !std::is_same<Tgt, Src>::value && !std::is_same<Tgt, bool>::value &&
std::is_arithmetic<Src>::value && std::is_arithmetic<Src>::value && std::is_arithmetic<Tgt>::value>;
std::is_arithmetic<Tgt>::value>;
} // namespace detail } // namespace detail
......
...@@ -1513,9 +1513,7 @@ class basic_fbstring { ...@@ -1513,9 +1513,7 @@ class basic_fbstring {
public: public:
template <class ItOrLength, class ItOrChar> template <class ItOrLength, class ItOrChar>
iterator insert(const_iterator p, ItOrLength first_or_n, ItOrChar last_or_c) { iterator insert(const_iterator p, ItOrLength first_or_n, ItOrChar last_or_c) {
using Sel = std::integral_constant< using Sel = bool_constant<std::numeric_limits<ItOrLength>::is_specialized>;
bool,
std::numeric_limits<ItOrLength>::is_specialized>;
return insertImplDiscr(p, first_or_n, last_or_c, Sel()); return insertImplDiscr(p, first_or_n, last_or_c, Sel());
} }
...@@ -2252,10 +2250,9 @@ inline void basic_fbstring<E, T, A, S>::replaceImpl( ...@@ -2252,10 +2250,9 @@ inline void basic_fbstring<E, T, A, S>::replaceImpl(
Invariant checker(*this); Invariant checker(*this);
// Handle aliased replace // Handle aliased replace
using Sel = std::integral_constant< using Sel = bool_constant<
bool,
std::is_same<FwdIterator, iterator>::value || std::is_same<FwdIterator, iterator>::value ||
std::is_same<FwdIterator, const_iterator>::value>; std::is_same<FwdIterator, const_iterator>::value>;
if (replaceAliased(i1, i2, s1, s2, Sel())) { if (replaceAliased(i1, i2, s1, s2, Sel())) {
return; return;
} }
......
...@@ -208,10 +208,9 @@ class fbvector { ...@@ -208,10 +208,9 @@ class fbvector {
typedef std::reverse_iterator<const_iterator> const_reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
private: private:
typedef std::integral_constant< typedef bool_constant<
bool,
is_trivially_copyable<T>::value && is_trivially_copyable<T>::value &&
sizeof(T) <= 16 // don't force large structures to be passed by value sizeof(T) <= 16 // don't force large structures to be passed by value
> >
should_pass_by_value; should_pass_by_value;
typedef typename std::conditional< typedef typename std::conditional<
......
...@@ -357,21 +357,19 @@ struct copy_assignment_mixin<T, true> { ...@@ -357,21 +357,19 @@ struct copy_assignment_mixin<T, true> {
template <typename T> template <typename T>
struct is_constructible_from_replaceable struct is_constructible_from_replaceable
: std::integral_constant< : bool_constant<
bool,
std::is_constructible<T, Replaceable<T>&>::value || std::is_constructible<T, Replaceable<T>&>::value ||
std::is_constructible<T, Replaceable<T>&&>::value || std::is_constructible<T, Replaceable<T>&&>::value ||
std::is_constructible<T, const Replaceable<T>&>::value || std::is_constructible<T, const Replaceable<T>&>::value ||
std::is_constructible<T, const Replaceable<T>&&>::value> {}; std::is_constructible<T, const Replaceable<T>&&>::value> {};
template <typename T> template <typename T>
struct is_convertible_from_replaceable struct is_convertible_from_replaceable
: std::integral_constant< : bool_constant<
bool,
std::is_convertible<Replaceable<T>&, T>::value || std::is_convertible<Replaceable<T>&, T>::value ||
std::is_convertible<Replaceable<T>&&, T>::value || std::is_convertible<Replaceable<T>&&, T>::value ||
std::is_convertible<const Replaceable<T>&, T>::value || std::is_convertible<const Replaceable<T>&, T>::value ||
std::is_convertible<const Replaceable<T>&&, T>::value> {}; std::is_convertible<const Replaceable<T>&&, T>::value> {};
} // namespace replaceable_detail } // namespace replaceable_detail
// Type trait template to statically test whether a type is a specialization of // Type trait template to statically test whether a type is a specialization of
......
...@@ -78,7 +78,7 @@ namespace detail { ...@@ -78,7 +78,7 @@ namespace detail {
* Handy shortcuts for some standard facilities * Handy shortcuts for some standard facilities
*/ */
template <bool B> template <bool B>
using Bool = std::integral_constant<bool, B>; using Bool = bool_constant<B>;
using True = std::true_type; using True = std::true_type;
using False = std::false_type; using False = std::false_type;
......
...@@ -88,9 +88,8 @@ using invoke_result_ = ...@@ -88,9 +88,8 @@ using invoke_result_ =
template <typename F, typename... Args> template <typename F, typename... Args>
struct invoke_nothrow_ struct invoke_nothrow_
: std::integral_constant< : bool_constant<noexcept(
bool, invoke(std::declval<F>(), std::declval<Args>()...))> {};
noexcept(invoke(std::declval<F>(), std::declval<Args>()...))> {};
// from: http://en.cppreference.com/w/cpp/types/result_of, CC-BY-SA // from: http://en.cppreference.com/w/cpp/types/result_of, CC-BY-SA
......
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