A
Aguilar, James
Hey y'all. Suppose I want a member template in a class, but I don't want to
include .hh files in a .hh file? For instance:
#ifndef _FOO_HH_
#define _FOO_HH_ 1
class Foo
{
public:
Foo()
private:
std:riority_queue<int> bar;
}
#endif
This doesn't work. So I tried adding this line above the line of class Foo:
class priority_queue<int>;
Doesn't work. Among other things that don't work are:
template<class T> priority_queue<T>;
priority_queue<int>;
class std:riority_queue<int>;
template<class T> std:riority_queue<T>;
std:riority_queue<int>;
My point is that I want to follow the style guidelines and not include
things in a header file . . . or wait, was it don't "use" namespaces in a
header file? In any case, what is the proper way to get this done? Should
I include the container in the header?
include .hh files in a .hh file? For instance:
#ifndef _FOO_HH_
#define _FOO_HH_ 1
class Foo
{
public:
Foo()
private:
std:riority_queue<int> bar;
}
#endif
This doesn't work. So I tried adding this line above the line of class Foo:
class priority_queue<int>;
Doesn't work. Among other things that don't work are:
template<class T> priority_queue<T>;
priority_queue<int>;
class std:riority_queue<int>;
template<class T> std:riority_queue<T>;
std:riority_queue<int>;
My point is that I want to follow the style guidelines and not include
things in a header file . . . or wait, was it don't "use" namespaces in a
header file? In any case, what is the proper way to get this done? Should
I include the container in the header?