I have a nested template class declared as follows:
template<typename T>
class IDMap
{
private:
struct Item {
uint16_t mVersion;
T mItem;
template <typename... Arguments>
Item(uint16_t version, Arguments&&... args);
};
}
Later I want to define a constructor item, here is my attempt:
template <typename T, typename... Arguments>
IDMap<T>::Item::Item(uint16_t version, Arguments&&... args) : mVersion(version), mItem(std::forward<Arguments>(args)...)
{
}
The above does not compile, it just says 'IDMap<T>::Item::{ctor}' : unable to match function definition to an existing declaration. Something is missing - what is the correct syntax?
source
share