Automatic Differentiation
 
Loading...
Searching...
No Matches
is_base_pointer_convertible.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_IS_BASE_POINTER_CONVERTIBLE_HPP
2#define STAN_MATH_PRIM_META_IS_BASE_POINTER_CONVERTIBLE_HPP
3
5#include <type_traits>
6#include <utility>
7
8namespace stan {
9
22template <template <typename> class Base, typename Derived>
24 static std::false_type f(const void *);
25 template <typename OtherDerived>
26 static std::true_type f(const Base<OtherDerived> *);
27 enum {
28 value
29 = decltype(f(std::declval<std::remove_reference_t<Derived> *>()))::value
30 };
31};
32
33} // namespace stan
34
35#endif
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
static std::false_type f(const void *)
static std::true_type f(const Base< OtherDerived > *)
Checks if a type's pointer is convertible to a templated base type's pointer.