Use*_*er1 2 c++ boost compilation xpressive
我有一个用boost :: xpressive写的非常短的程序
#include <iostream>
#include <boost/xpressive/xpressive.hpp>
using namespace boost::xpressive;
int main()
{
std::string hello( "hello world!" );
sregex rex = sregex::compile( "(\\w+) (\\w+)!" );
smatch what;
if( regex_match( hello, what, rex ) )
{
std::cout << what[0] << '\n'; // whole match
std::cout << what[1] << '\n'; // first capture
std::cout << what[2] << '\n'; // second capture
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这是Xpressive"你好世界".编译需要比普通的hello世界更长的时间.我认为这是因为xpressive.hpp文件非常庞大.有没有办法预编译或预处理.hpp文件,以便编译速度更快?
| 归档时间: |
|
| 查看次数: |
315 次 |
| 最近记录: |