Re: [Cppcms-users] Compile error: traits is not a template
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2012-09-01 06:34:34
|
>
>But I got error when compiling another class. It has group.h and group.cpp file.
>
>
>#ifndef __GROUP_H
>#define __GROUP_H
>
>
>#include <string>
>
>
>namespace kaimei{
>...
}
>
>
>namespace cppcms {
> namespace json {
> template<>
> struct traits<kaimei::group> {
>...
> }
> }
>}
>
>
>
> [snip]
>
>I am not good at template programming. Why did this happen?
>
You can't specialize undefined struct - you need to include <cppcms/json.h>
header. It provides the original traits struct and than you specialize it for
your type of class
>
>陈抒
>Best regards
>http://blog.csdn.net/sheismylife
>
Regards,
Artyom
|