#include <iostream>
#include <string>
template<int32_t Exponent, int64_t Mantissa>
struct FieldDecimalOptionalState
{
FieldDecimalOptionalState():exponent_(Exponent), mantissa_(Mantissa)
{
}
int32_t exponent_;
int64_t mantissa_;
};
template<int32_t Exponent, int64_t Mantissa ,FieldDecimalOptionalState<Exponent,Mantissa> *member>
struct OptionalFieldDecimal
{
OptionalFieldDecimal(): value(0)
{
}
OptionalFieldDecimal(std::string const& dec): value(dec)
{
}
std::string value;
};
int main()
{
FieldDecimalOptionalState<5,6> fos;
OptionalFieldDecimal<5,6,&fos> ofd; // edited.
return 0;
}
I am getting these errors.
temp.cpp: In function âint main()â:
temp.cpp:29: error: template argument 3 is invalid
temp.cpp:29: error: invalid type in declaration before â;â token
What is wrong in my code????
This post has been edited by bnc: 08 February 2012 - 09:15 AM

New Topic/Question
Reply




MultiQuote







|