私は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;
}
それは、Xpressive の「Hello World」です。コンパイルには、通常の hello world よりもかなり時間がかかります。xpressive.hpp ファイルが非常に大きいためだと思います。.hpp ファイルをプリコンパイルまたはプリプロセスしてコンパイルを高速化する方法はありますか?