C++14元编程增强库 IOD

码农软件 · 软件分类 · 其他开发相关 · 2019-10-21 18:42:40

软件介绍

IOD 库通过一个基于符号的图表增强了 C++14 元编程特性。提供一个编译时的方法来检视对象并生成匹配对象结构的代码。

支持的编译器:

  • GCC 4.9

  • Clang 3.4

示例代码:

// Define an object
auto o = D(_Name = "John", _Age = 42, _City = "NYC");
// Direct access to its members.
assert(o.name == "John" && o.age == 42 && o.city == "NYC");

// Static Introspection. It has no execution cost since these function
// are computed at compile time.
assert(o.has(_Name) == true);
assert(o.has(_FirstName) == false);
assert(o.has(_FirstName) == false);
assert(o.size() == 3);

// Output the structure of the object to std::cout:
// name:John
// age:42
// city:NYC
foreach(o) | [] (auto& m) { std::cout << m.symbol().name() << ":"
                                    << m.value() << std::end; }

本文地址:https://www.codercto.com/soft/d/17263.html

The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and

The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and

Jeremy Kubica / No Starch Press / 2016-8-15 / USD 13.74

Meet Frank Runtime. Disgraced ex-detective. Hard-boiled private eye. Search expert.When a robbery hits police headquarters, it's up to Frank Runtime and his extensive search skills to catch the culpri......一起来看看 《The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and 》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具