boost::p rocess::env 在 ubuntu 19.04 上坏了?

boost::process::env broken on ubuntu 19.04?

本文关键字:坏了 rocess env boost ubuntu      更新时间:2023-10-16

以下C++程序:

#include <boost/process/env.hpp>
int main() {}

不会编译:

$ g++ test.cc
In file included from test.cc:1:
/usr/include/boost/process/env.hpp:107:19: error: ‘is_wchar_t’ is not a class template
template<> struct is_wchar_t<env_set<wchar_t>>           : std::true_type {};
^~~~~~~~~~

我使用的是带有 gcc 8.3.0 和 libboost1.67-dev 的 Ubuntu 19.04。

有什么想法吗?

解决方法是包含定义is_wchar_t模板的文件:

#include <boost/process/detail/traits/wchar_t.hpp>