vkubicki
vkubicki

Reputation: 1124

Error with type alias

I would like to use a type alias to create a template with one argument, from a template with two arguments:

// forward declaration
template<int Id, typename MixtureManager> class MixtureBridge;

/**
 *  Specialization of the MixtureTraits for the Gaussian_sjk_ model
 **/
template<>
struct BridgeTraits<STK::Clust::Gaussian_sjk_>
{
   // ... some traits
};

template <typename MixtureManager>
using GaussianBridge_sjk_m = MixtureBridge<STK::Clust::Gaussian_sjk_, MixtureManager>;

I get the following error message:

mixt_GaussianBridges.h:65:1: error: expected unqualified-id before 'using'

What is wrong with my syntax ?

Note: I am working with gcc 4.6.3, on Windows

Upvotes: 0

Views: 246

Answers (2)

Jarod42
Jarod42

Reputation: 217275

Template aliases are not supported in gcc 4.6 : https://gcc.gnu.org/gcc-4.6/cxx0x_status.html

upgrade your compiler to a more recent version.

Upvotes: 3

user657267
user657267

Reputation: 21000

Alias-declarations are only supported from gcc 4.7 onwards

https://gcc.gnu.org/gcc-4.7/changes.html

Upvotes: 1

Related Questions