template

closed account (jGAShbRD)
#ifndef FAST_QUEUE_H
#define FAST_QUEUE_H
#include <iostream>
#include <vector>
#include <algorithm>
#include <exception>

template <typename T>
class FastQueue
{
public:
FastQueue(); //default constructor
...others stuff
--------------------------------------------------------------------------------
#ifndef FAST_QUEUE_H
#define FAST_QUEUE_H
#include "FastQueue.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <exception>

template <typename T>
FastQueue<T>::FastQueue() //default constructor
{
...stuff
}
-----------------------------------------------------------
when i compile both these files with my main im getting an error saying no template name FastQueue on my cpp file but i checked all myheaders and they are there
when i move all mycpp functions into myh file it works but i want 2 files an h file and a cpp file
Last edited on
closed account (jGAShbRD)
should i include inline when i define each function?
Should i include inline when i define each function?


No, function templates are implicitly inline
closed account (jGAShbRD)
thanks
Topic archived. No new replies allowed.