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

What Technology Wants

What Technology Wants

Kevin Kelly / Penguin Group (USA) Incorporated / 2010-10-14 / USD 27.95

A refreshing view of technology as a living force in the world. This provocative book introduces a brand-new view of technology. It suggests that technology as a whole is not a jumble of wires and ......一起来看看 《What Technology Wants》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具