C++

Total posts: 4

用 C++ 写一个玩具 JSON 库

写这个解析器主要是为了看自己的 C++ 水平,毕竟 JSON 是一个同时能做到语法简单的同时考验人的编码水平的 data structure,其次是为了好玩。 好玩吗?好玩。

DIY std::optional: Using Universal References in C++

This blog was written entirely because of the item Familiarize yourself with alternatives to overloading on universal references in Effcetive Morden C++. We start with a practical problem trying to emulate std::optional in C++14, because optional monads are a good paradigm for expressing values ​​that may be null, rather than assuming everything is maybe null which can easily break through the type system. 写下这篇文章完全是因为看到了 Effcetive Morden C++ 中的熟悉通用引用重载的替代方法。我们从一个现实的问题开始,即在 C++14 尝试模拟 std::optional,因为 optional 是表达可能为空的值的时候一个很好的范式,而不是假定一切都可能为 null 并轻易击穿类型系统。