Templates Not working

For some reason it keeps saying missing ; before template<

BTW INLINE is __forceinline. I already tried removing it and it didnt help

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "Resolver.h"
#include "DataTypes.h"

template <class T>
INLINE void swap(T& a, T& b) {

	T temp = a; // A temporary variable is needed for swapping values
	a = b;
	b = temp;
}

INLINE void* reverse_endian(char *ptr, size_t byteWidth, size_t size);

INLINE void* int8_to_int32(int32_t *dest, const int8_t *source, size_t size);
INLINE void* int16_to_int32(int32_t *dest, const int16_t *source, size_t size);
INLINE void* int24_to_int32(int32_t *dest, const int24_t *source, size_t size);
INLINE void* int32_to_int64(int64_t *dest, const int32_t *source, size_t size);

INLINE void* int32_to_int8(int8_t *dest, const int32_t *source, size_t size);
INLINE void* int32_to_int16(int16_t *dest, const int32_t *source, size_t size);
INLINE void* int32_to_int24(int24_t *dest, const int32_t *source, size_t size);
INLINE void* int64_to_int32(int32_t *dest, const int64_t *source, size_t size);

Last edited on
This is also happening in my other templated class source file but it is too long to post
What does DataTypes.h look like? You probably forgot a semicolon at the end of a class.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __DATATYPES__
#define __DATATYPES__

#include <Windows.h>

// Define processing data types
typedef INT32 Int32;
typedef INT64 Int64;
typedef FLOAT Float32;
typedef DOUBLE Float64;

// Most architectures do not include a 24 bit integer
#ifndef INT24
#define INT24
#pragma pack(push, 1) // This will align all of the data nicely

// This structure is used only for pointers
struct __int24 {

	char bytes[3];
};

#pragma pack(pop) // Restore old alignment
#endif

// Define sample types
#ifndef _STDINT
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
#endif
typedef __int24 int24_t;
typedef float float32_t;
typedef double float64_t;

#endif 


I'm also getting this, don't know if it's related at all
 
error C2064: term does not evaluate to a function taking 0 arguments


EDIT: That above error has nothing to do with it. That was a threading issue I had.
Last edited on
Topic archived. No new replies allowed.