短耳可以在不提升或C ++ 11使用吗? [英] Can Asio be used without boost or C++11?

查看:133
本文介绍了短耳可以在不提升或C ++ 11使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待在图书馆,帮助建立一个可扩展的TCP / IP服务器,和boost :: ASIO看起来pretty不错,使跨平台的异步接口I / O工作均匀(我们需要至少支持OSX,于Linux x86和Windows,可能的Solaris,或许HP-UX和放大器; AIX)

I'm looking at libraries to help build a scalable tcp/ip server, and Boost::ASIO looks pretty nice to make async socket i/o work homogeneously across platforms (We need to support at least OSX, Linux x86, and Windows, probably Solaris, maybe HP-UX & AIX).

管理是死心塌地对我们的产品使用Boost,主要是由于它是'臃肿',而且由于问题,我们已经在与冲突的过去,因为我们的code被静态地客户联系code(其也可以使用升压,可能不一样的版本)。

Management is dead-set against using Boost in our product, mostly due to it being 'bloated', and due to issues we've had in the past with conflicts, as our code gets statically linked with customer code (which may also be using boost, possibly not the same version).

借助短耳页面声称,它可以在不提升可以使用,但这是pretty含糊,后面还写着当使用C ++ 11 ...短耳可以独立加速的使用...,这似乎意味着它不会在C ++编译器03工作。我想我可以简单地包括头部,以避免冲突的象征发行前做一个#定义ASIO proprietary_asio。

The Asio page claims that it can be used without boost, although it's pretty vague, as later it also says "When using C++11 ... Asio can be used independently of Boost ...", which seems to imply it won't work on a C++03 compiler. I was thinking I could simply do a '#define asio proprietary_asio' before including the header to avoid the symbol clash issue.

我刚刚测试了我的本地机器上VS2013,并编制;有谁知道,特别是需要C ++ 11的功能?我需要(至少是)对Linux的支持VS2012 / 2013在Windows上,GCC 4.4(4.3可能),以及X code 5.1 OSX。

I just tested VS2013 on my local machine, and it compiled; Does anyone know which particular C++11 features are needed? I need to (at the very least) support VS2012/2013 on windows, gcc 4.4 (maybe 4.3) on linux, and XCode 5.1 on OSX.

我猜这个问题将是与旧版本的GCC ...

I'm guessing the problem is going to be with the old version of GCC...

推荐答案

我使用ASIO与MS VC ++ 2013年,不使用Boost的任何其他部分。

I've used ASIO with MS VC++ 2013, without using any other parts of Boost.

大多数ASIO code使用的boost ::绑定,但VC ++ 2013包含一个的std ::绑定该作业正常工作。升压演示code相当数量还使用的boost ::阵列,但是这仅仅是一个相当普通的数组 - 您可以使用 STD ::阵列的std ::矢量,或任何其他的可能性。

Most ASIO code uses boost::bind, but VC++ 2013 includes a std::bind that works fine for the job. A fair amount of Boost demo code also uses boost::array, but this is just a fairly ordinary array--you can use std::array, or std::vector, or any number of other possibilities.

警告:虽然这在我做什么工作对我很好,我是pretty肯定我没有使用ASIO的所有部分,我更加肯定我没有将它们结合在一起百般。因此,我可以说,它已经工作过,我不记得这似乎是与缺乏使用Boost的其他部分的任何问题,但在当时的时候,它总是有可能(取决于你用​​什么以及如何)你可能会遇到,我只是从来没有遇到过的问题(比如,一些作品有的boost ::绑定这是行不通的(至少以同样的方式),用VC ++ 2013的实施的std ::绑定

Warning: while this has worked fine for me in what I've done, I'm pretty certain I haven't used all parts of ASIO, and I'm ever more certain I haven't combined them in every possible way. As such, I can say it has worked, and I don't recall any issues that seemed to be related to lack of using other parts of Boost, but at the time time, it's always possible that (depending what you use and how) you could run into an issue I simply never encountered (e.g., something that works with boost::bind that just doesn't work (at least the same way) with VC++ 2013's implementation of std::bind.

其他的编译器是少了很多肯定的 - 用gcc的新版本,不会有什么问题,但是4.4或4.3 pretty该死的老。它已经足够长的时间,因为我做了OS X,我是不确定的任何使用X code 5.1中有哪些编译器。

The other compilers are a lot less certain--with a newer version of gcc, there would be no problem, but 4.4 or 4.3 is pretty darned old. It's been long enough since I did anything on OS X that I'm uncertain what compiler goes with XCode 5.1.

这篇关于短耳可以在不提升或C ++ 11使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆