Bug #408
‘intrusive_ptr_add_ref’ was not declared in this scope
Status: | Resolved | Start date: | 07/10/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | M. Rolf | % Done: | 100% | |
Category: | - | Estimated time: | 3.00 hours | |
Target version: | NemoMath 0.1 |
Description
‘intrusive_ptr_add_ref’ was not declared in this scope
‘intrusive_ptr_release’ was not declared in this scope
Code to reproduce attached.
Build against /vol/corcse/releases/trunk/lib/pkgconfig
Related issues
History
#1 Updated by M. Rolf almost 13 years ago
- Status changed from New to In Progress
Minimal example:
#include <iostream>
#include "Vector.h"
namespace foo {
class FOO1 {
public:
FOO1 : value(v) {}
nemo::RealVector get(){return value;}
void set(nemo::RealVector v){this->value = v;}
private:
nemo::RealVector value;
};
}
int main(){
foo::FOO1 a(nemo::RealVector(2));
std::cout << a.get() << std::endl;
nemo::RealVector x(3);
a.set(x);
std::cout << a.get() << std::endl;
}
#2 Updated by M. Rolf almost 13 years ago
- % Done changed from 0 to 10
#3 Updated by M. Rolf almost 13 years ago
"Argument-dependent lookup" (http://www.gotw.ca/gotw/030.htm) should actually do the job...
This might be a compiler bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34870
Resolved in gcc 4.5 with test code very similar to this one:
http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/g%2B%2B.dg/lookup/koenig7.C?view=markup&pathrev=153958
#4 Updated by M. Rolf almost 13 years ago
- % Done changed from 10 to 40
Dirty hot-fix:
Seems to work if a static instance of MathVector<T> is instantiated at the beginning of each compilation unit:
#include "Vector.h"
nemo::RealVector foo1;
nemo::MathVector<TypeOfYourInterest> foo2;
#5 Updated by M. Rolf almost 13 years ago
- Status changed from In Progress to Resolved
- % Done changed from 40 to 100
Fixed with workaround: IntrusiveCowSupport now tries to use member functions newly defined in IntrusiveCounted
If you compile on GCC >=4.5, you might want to use the original version. Do so
by setting NO_GCC_ADL_WORKAROUND=true in cmake configuration.
#6 Updated by M. Rolf almost 13 years ago
- Target version set to NemoMath 0.1