mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Recover compile-time size from seq(A,B) when A and B are fixed values. (c++11 only)
This commit is contained in:
@@ -28,6 +28,10 @@ template<int N> struct fix_t {
|
||||
}
|
||||
|
||||
fix_t<-N> operator-() const { return fix_t<-N>(); }
|
||||
template<int M>
|
||||
fix_t<N+M> operator+(fix_t<M>) const { return fix_t<N+M>(); }
|
||||
template<int M>
|
||||
fix_t<N-M> operator-(fix_t<M>) const { return fix_t<N-M>(); }
|
||||
|
||||
#if EIGEN_HAS_CXX14
|
||||
// Needed in C++14 to allow fix<N>():
|
||||
|
||||
@@ -163,6 +163,13 @@ struct is_symbolic {
|
||||
enum { value = internal::is_convertible<T,BaseExpr<T> >::value };
|
||||
};
|
||||
|
||||
// Specialization for functions, because is_convertible fails in this case.
|
||||
// Useful in c++98/11 mode when testing is_symbolic<decltype(fix<N>)>
|
||||
template<typename T>
|
||||
struct is_symbolic<T (*)()> {
|
||||
enum { value = false };
|
||||
};
|
||||
|
||||
/** Represents the actual value of a symbol identified by its tag
|
||||
*
|
||||
* It is the return type of SymbolValue::operator=, and most of the time this is only way it is used.
|
||||
|
||||
Reference in New Issue
Block a user