Ref<> objects must be nested by reference because they potentially store a temporary object

(transplanted from 6719e56b5bfe9ae4badc9a6e894c5824f663d62e
)
This commit is contained in:
Gael Guennebaud 2013-08-11 17:52:43 +02:00
parent 47a7de7b53
commit b56348046f
2 changed files with 5 additions and 4 deletions

View File

@ -94,7 +94,8 @@ struct traits<Ref<_PlainObjectType, _Options, _StrideType> >
typedef _PlainObjectType PlainObjectType;
typedef _StrideType StrideType;
enum {
Options = _Options
Options = _Options,
Flags = traits<Map<_PlainObjectType, _Options, _StrideType> >::Flags | NestByRefBit
};
template<typename Derived> struct match {

View File

@ -14,9 +14,9 @@
static int nb_temporaries;
inline void on_temporary_creation(int size) {
inline void on_temporary_creation(int) {
// here's a great place to set a breakpoint when debugging failures in this test!
if(size!=0) nb_temporaries++;
nb_temporaries++;
}