aaragon wrote:
::PropertyType Map()
::PropertyTag(), *g_);
> On Apr 10, 5:37 pm, Christopher
>> On Apr 10, 4:58 pm, aaragon
>>
>>
>>
>> > Hello everyone,
>>
>> > I run across this problem:
>>
>> > I have a project that has a class with a template function, something
>> > like the following:
>>
>> > class SomeClass {
>> > ...
>> > public:
>> > template
>> > inline typename PropertyTraits
>> > {
>> > return boost::get(typename
>> > PropertyTraits
>> > }
>> > ...
>>
>> > };
>>
>> > so you can see that this function takes an enumerated type:
>>
>> > enum PROPERTY { POINT, WEIGHT};
>>
>> > // define local classes
>> > template
>> > class PropertyTraits;
>>
>> > template
>> > struct PropertyTraits
>> > typedef vertex_point_t PropertyTag;
>> > typedef typename boost::property_map
>> > PropertyType;};
>>
>> > template
>> > struct PropertyTraits
>> > typedef edge_weight_t PropertyTag;
>> > typedef typename boost::property_map
>> > PropertyType;
>>
>> > };
>>
>> > Now, in some other code, I have a function template that takes as a
>> > template parameter an object that can be an object of SomeClass.
>>
>> > class OtherClass {
>> > ...
>> > template
>> > void operator()(CL& c) {
>> > ...
>> > mvac_.template Map
>> > ...
>> > }
>> > ...
>>
>> > };
>>
>> > Now, when I do this, the compiler says:
>>
>> > domain.h:638: error: 'POINT' was not declared in this scope
>>
>> > and this is ok because I don't want the code of OtherClass to know
>> > about any enumerated types or classes in the first project. I tried
>> > replacing POINT by 0 and it compiles, but then when I have to compile
>> > the original code I have:
>>
>> > domain.h:638: error: no matching function for call to 'mvac::mVAC3<2,
>> > mvac::DomainTraits<2> >::Map()'
>>
>> > Does anyone knows how can I call this template function? Thank you
>> > all,
>>
>> > aa
>>
>> Qualify the enumerated type? include the proper file?
>> Depends where it is defined... By what you have written I would assume
>> with low confidence that it is global? , but then I doubt you would be
>> getting the error.
>>
>> You didn't clearly show where the enum was defined, filenames, or
>> where the error occured. I don't know where line 638 is in your pasted
>> code.
>
> Ok, the idea is that there are two projects that are completely
> independent of each other. As such, the SomeClass is in the first
> project, with the enumerated type being global. The other project only
> knows about SomeClass through a template parameter, so it can have
> access to SomeClass public typedefs and member functions.
The projects cannot be completely independent of one another. In order to
use SomeClass as a template parameter when a template is instantiated, the
second project needs to know SomeClass.
Best
Kai-Uwe Bux