Compilation with Templates

A

Ajay Daptardar

Hi,

Consider the foll:

// codec.h
template <class T, class UT>
class codec {
public:

enum PREDICTOR_TYPE {NO_PREDICTOR, UNIT_DELAY_PREDICTOR};

/**
* Default constructor. Set the configuration parameters for the codec.
*
* @param n - Data resolution in bits per sample. 0 < n <= 32.
* @param J - Block length for a coded data set (CDS). J = 8 or 16.
* @param L - No. of CDSes in a packet. 0 < L <= 4096.
* @param r - No. of CDSs between references. 0 < r <= 256.
* @param ptype - Type of predictor to be used.
* @param sgn - Sense of digital signal, true if bipolar, false if positive.
*/
codec(int n, int J, int L, int r, int ptype, bool sgn);
template <class T, class UT>
 
T

Thomas Matthews

Ajay said:
Hi,

Consider the foll:

// codec.h
template <class T, class UT>
class codec {
public:

enum PREDICTOR_TYPE {NO_PREDICTOR, UNIT_DELAY_PREDICTOR};

/**
* Default constructor. Set the configuration parameters for the codec.
*
* @param n - Data resolution in bits per sample. 0 < n <= 32.
* @param J - Block length for a coded data set (CDS). J = 8 or 16.
* @param L - No. of CDSes in a packet. 0 < L <= 4096.
* @param r - No. of CDSs between references. 0 < r <= 256.
* @param ptype - Type of predictor to be used.
* @param sgn - Sense of digital signal, true if bipolar, false if positive.
*/
codec(int n, int J, int L, int r, int ptype, bool sgn);
template <class T, class UT>

It was considered.
Not compilable. Missing closing '}' for the class declaration.
What is the 2nd "template <class T, class UT>" describing?

Is there an example that uses this malformed template?

By the way, one posting will do. Five won't get you a faster
response than one.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,416
Latest member
LionelQ387

Latest Threads

Top