Lines Matching defs:std

69 // (e.g. std::negation) added in 2015u3:
220 size_t len = std::strlen(compiled_ver); \
221 if (std::strncmp(runtime_ver, compiled_ver, len) != 0 \
235 } catch (const std::exception &e) { \
299 using size_t = std::size_t;
327 /** Use std::move to move the return value contents into a new instance
363 * to holder either a std::unique_ptr or std::shared_ptr (which is almost always
364 * sizeof(std::shared_ptr<T>)).
367 static_assert(sizeof(std::shared_ptr<int>) >= sizeof(std::unique_ptr<int>),
368 "pybind assumes std::shared_ptrs are at least as big as std::unique_ptrs");
369 return size_in_ptrs(sizeof(std::shared_ptr<int>));
399 * holder will fit in the default space (which is large enough to hold either a std::unique_ptr
400 * or std::shared_ptr).
440 static_assert(std::is_standard_layout<instance>::value, "Internal error: `pybind11::detail::instance` is not standard layout!");
444 using std::enable_if_t;
445 using std::conditional_t;
446 using std::remove_cv_t;
447 using std::remove_reference_t;
449 template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type;
450 template <bool B, typename T, typename F> using conditional_t = typename std::conditional<B, T, F>::type;
451 template <typename T> using remove_cv_t = typename std::remove_cv<T>::type;
452 template <typename T> using remove_reference_t = typename std::remove_reference<T>::type;
457 using std::index_sequence;
458 using std::make_index_sequence;
472 /// Backports of std::bool_constant and std::negation to accommodate older compilers
473 template <bool B> using bool_constant = std::integral_constant<bool, B>;
485 template <class... Ts> using all_of = std::is_same<
490 // MSVC has trouble with the above, but supports std::conjunction, which we can use instead (albeit
492 template <class... Ts> using all_of = std::conjunction<Ts...>;
493 template <class... Ts> using any_of = std::disjunction<Ts...>;
578 /// unlike `std::is_base_of`)
580 std::is_base_of<Base, Derived>::value && !std::is_same<Base, Derived>::value>;
585 std::is_base_of<Base, Derived>::value && std::is_convertible<Derived *, Base *>::value>;
589 template <typename... Us> static std::true_type check(Base<Us...> *);
590 static std::false_type check(...);
605 struct is_instantiation : std::false_type { };
607 struct is_instantiation<Class, Class<Us...>> : std::true_type { };
609 /// Check if T is std::shared_ptr<U> where U can be anything
610 template <typename T> using is_shared_ptr = is_instantiation<std::shared_ptr, T>;
613 template <typename T, typename = void> struct is_input_iterator : std::false_type {};
615 struct is_input_iterator<T, void_t<decltype(*std::declval<T &>()), decltype(++std::declval<T &>())>>
616 : std::true_type {};
619 std::is_pointer<T>::value && std::is_function<typename std::remove_pointer<T>::type>::value>;
628 std::is_function<F>::value,
631 std::is_pointer<F>::value || std::is_member_pointer<F>::value,
632 std::remove_pointer<F>,
641 std::is_function, std::is_pointer, std::is_member_pointer>;
657 class builtin_exception : public std::runtime_error {
659 using std::runtime_error::runtime_error;
680 [[noreturn]] PYBIND11_NOINLINE inline void pybind11_fail(const char *reason) { throw std::runtime_error(reason); }
681 [[noreturn]] PYBIND11_NOINLINE inline void pybind11_fail(const std::string &reason) { throw std::runtime_error(reason); }
692 template <typename T> struct is_fmt_numeric<T, enable_if_t<std::is_arithmetic<T>::value>> {
694 static constexpr int index = std::is_same<T, bool>::value ? 0 : 1 + (
695 std::is_integral<T>::value ? detail::log2(sizeof(T))*2 + std::is_unsigned<T>::value : 8 + (
696 std::is_same<T, double>::value ? 1 : std::is_same<T, long double>::value ? 2 : 0));
700 template <typename T> struct format_descriptor<T, detail::enable_if_t<std::is_arithmetic<T>::value>> {
703 static std::string format() { return std::string(1, c); }
709 T, detail::enable_if_t<std::is_arithmetic<T>::value>>::value[2];
733 constexpr auto operator()(Return (Class::*pmf)(Args...), std::false_type = {}) const noexcept
737 constexpr auto operator()(Return (Class::*pmf)(Args...) const, std::true_type) const noexcept
756 static constexpr auto const_ = std::true_type{};
760 static_assert(detail::deferred_t<std::false_type, Args...>::value,
768 // any standard container (or C-style array) supporting std::begin/std::end, any singleton
772 std::vector<T> v;
781 template <typename Container, typename = enable_if_t<std::is_convertible<decltype(*std::begin(std::declval<const Container &>())), T>::value>>
782 any_container(const Container &c) : any_container(std::begin(c), std::end(c)) { }
786 template <typename TIn, typename = enable_if_t<std::is_convertible<TIn, T>::value>>
787 any_container(const std::initializer_list<TIn> &c) : any_container(c.begin(), c.end()) { }
790 any_container(std::vector<T> &&v) : v(std::move(v)) { }
793 operator std::vector<T> &&() && { return std::move(v); }
796 std::vector<T> &operator*() { return v; }
797 const std::vector<T> &operator*() const { return v; }
800 std::vector<T> *operator->() { return &v; }
801 const std::vector<T> *operator->() const { return &v; }