The following repo compiles fine:
#include <tuple>
#include <vector>
class Foo
{
public:
typedef std::tuple<int, int> foo_type;
std::vector<foo_type>::iterator Find() {
return Listeners.begin();
}
std::vector<foo_type> Listeners;
};
int main()
{
Foo foo;
auto i = foo.Find();
}
But when I template the tuple on P, Q as in the following repo, I get this error:
syntax error : missing ';' before identifier 'Find'
#include <tuple>
#include <vector>
template<typename P, typename Q>
class Foo
{
public:
typedef std::tuple<P, Q> foo_type;
std::vector<foo_type>::iterator Find() {
return Listeners.begin();
}
std::vector<foo_type> Listeners;
};
int main()
{
Foo<int, int> foo;
auto i = foo.Find();
}
foo_type;`
– Borgleader Apr 14 '15 at 20:28