相关疑难解决方法(0)

类型特征定义.特征blob和元功能

阅读一些源代码,我发现了下一个特征定义:

namespace dds {  
   template <typename Topic> struct topic_type_support { };
   template <typename Topic> struct topic_data_writer { };
   template <typename Topic> struct topic_data_reader { };
   template <typename Topic> struct topic_data_seq { };
}

#define REGISTER_TOPIC_TRAITS(TOPIC) \
namespace dds { \
   template<> struct topic_type_support<TOPIC> { \
      typedef TOPIC##TypeSupport type; }; \
   template<> struct topic_data_writer<TOPIC> { \
      typedef TOPIC##DataWriter type; }; \
   template<> struct topic_data_reader<TOPIC> { \
      typedef TOPIC##DataReader type; }; \
   template<> struct topic_data_seq<TOPIC> { \
      typedef TOPIC##Seq type; }; \ …
Run Code Online (Sandbox Code Playgroud)

c++ templates type-traits

7
推荐指数
1
解决办法
1115
查看次数

标签 统计

c++ ×1

templates ×1

type-traits ×1