future in c++0x

标题玩了个文字游戏,其实只是小试了下 c++0x 的 std::future 及相关类。

gcc 对 c++0x 的支持还算可以。记得编译时加上 -std=c++0x 参数。
注意 std::thread task_thread(std::move(task)); 这句因为 gcc 4.6 std::bind 的 bug 编译错误。

coding 的感想是,c++ 模板编程的错误消息实在极不友好,作为一个语言和标准库来说,这是没法容忍的。

Advertisements
This entry was posted in Computer and Internet, Programming and Algorithm and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s