Problem with template class ?
I'm assuming this problem is happening because the classes are template classes. Here's a cut-down version of the code that's giving me the problem:-
Code:
template<typename Time> class Note;
template<typename Time>
class Sequence : virtual public ControlSet {
public:
// c'tors etc
public:
struct EarlierNoteComparator {
inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
const boost::shared_ptr< const Note<Time> > b) const {
return musical_time_less_than (a->time(), b->time());
}
};
typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr;
typedef std::multiset<NotePtr, EarlierNoteComparator> Notes;
void set_notes (const Sequence<Time>::Notes& n);
};
Basically, the above code compiles with gcc but when I try to compile it with MSVC (version 8) I get this error at the red line:-
Quote:
error C2061: syntax error : identifier 'Notes'
Can anyone tell me what the problem is?
Re: Problem with template class ?
Looks like a case where you need to disambiguate with typename, e.g.,
Code:
void set_notes (const typename Sequence<Time>::Notes& n);
Re: Problem with template class ?
Thanks Laserlight, you just beat me to it (I just found the same result purely by trial and error!)