Non-Profit, International

Spirit unsterblich.

  • 深入C++模块

    字数统计:4296
    之前的文章 C++ 模块介绍了模块的基本概念和语法,但仍然缺乏系统性的指导。该文章总结了我过去使用模块的经验,对于大部分人来说应该足够了。
  • Modules In Depth

    字数统计:2608
    The previous article C++ Modules introduced the basic concepts and syntax of modules, but still lacked systematic guidance. This article summarizes my experience using modules over the past years and should be sufficient for most people.
  • 停止使用 AttachConsole

    字数统计:662
    Windows XP开始提供了一个函数 AttachConsole,它的用途是使得Subsystem为Windows的GUI/后台程序,在使用控制台执行时可以获得控制台的输入输出句柄,使得它们既可以独立使用也可以和控制台配合使用。但该函数实际上存在缺陷使得它不能很好完成该任务。
  • C++ Modules

    字数统计:1467
    An important feature of C++20 is modules, a completely new way of organising source files. It aims to solve the problems of overly large translation units and repeated template instantiations caused by the traditional source‑file inclusion model, thereby speeding up compilation.
  • Strategies for Implementing POSIX Condition Variables on Win32

    字数统计:6423
    本文是Douglas C. Schmidt和Irfan Pyarali的文章 Strategies for Implementing POSIX Condition Variables on Win32 的备份,由于原文链接已经失效。我从 Wayback Machine 重新找到原文并改写为 markdown。
  • 如何实现一个constexpr构造的互斥锁

    字数统计:1245
    C++11为语言和标准库带来了多线程支持,对于用户来说,一个非常重要的特性就是互斥锁。C++11对于 std::mutex 有一个非常微妙的要求(见N2994LWG828):它的构造函数需要是 constexpr 的。咋一看该要求在早期Windows上不能实现,因为Critical Section需要使用InitializeCriticalSection初始化底层字节为非0的有意义值,其他内核对象(例如Mutex)也是如此。但实际上它是可以实现的,只是可能稍微增加一些锁冲突。
  • C++/WinRT Plus:将C++标准模块引入Windows开发

    字数统计:2511
    以下是我怎么实现的它。