I am currently trying to integrate a library (IsoAgLib) into my CPP project. I am not deeply experienced with CPP. The error I am getting is: "expected unqualified-id before '{' token". I believe it has something to do with templates as I have come across other similar issues. It might also have something to do with the abs function call. Any help would be much appreciated!
EDIT: I am leaving out code after the template, the file is quite large
Error 45 expected unqualified-id before '{' token
Error 47 expected unqualified-id before ')' token
Error 46 expected ')' before '{' token
all of these errors occur on line 31 which is "template inline T abs(const T& val)" (I left commenting out at the beginning)
#ifndef UTIL_FUNCS_H
#define UTIL_FUNCS_H
#include <IsoAgLib/isoaglib_config.h>
#ifdef USE_DATASTREAMS_IO
class StreamInput_c;
#endif
#include <cstdlib> // Include before vector or else CNAMESPACE stuff is screwed up for Tasking
#include <cstring>
#include <vector>
#ifdef USE_VT_UNICODE_SUPPORT
#include <string>
#endif
// Begin Namespace __IsoAgLib
namespace __IsoAgLib
{
template <class T> inline T abs(const T& val)
{
return (val < 0) ? (-val) : val;
}
} // end of namespace __IsoAgLib
#endif