[Nfd-dev] Using (some features of) C++11

Davide Pesavento davide.pesavento at lip6.fr
Sun Oct 19 09:30:24 PDT 2014


It's not true in general that C++03 code can be compiled with a C++11
compiler. C++11 introduces some changes that may break code that used
to be valid in C++03, see [1] for some examples. Admittedly, most of
them are corner cases or are trivially fixable.

Again, I agree with moving completely to C++11, and given that this
project is quite young, there shouldn't be much legacy code around
anyway.

So should we just ignore C++98/03 compatibility? I'd like to have some
consensus before moving forward on this.

[1] http://stackoverflow.com/questions/6399615/what-breaking-changes-are-introduced-in-c11

Thanks,
Davide

On Sun, Oct 19, 2014 at 5:50 PM, Junxiao Shi
<shijunxiao at email.arizona.edu> wrote:
> Hi Davide
>
> C++03 code can be compiled with C++11 compiler. Forcing dependent projects
> to use C++11 only requires them to change Makefile or wscript, which is
> trivial; there's no code change needed.
>
> There's major performance benefit to make ndn-cxx compile in C++11
> exclusively. The benefit mainly comes from move constructors, either used
> directly or used indirectly from STL.
>
> Yours, Junxiao
>
> On Sun, Oct 19, 2014 at 8:45 AM, Davide Pesavento <davide.pesavento at lip6.fr>
> wrote:
>>
>> On Sun, Oct 19, 2014 at 5:28 PM, Junxiao Shi
>> <shijunxiao at email.arizona.edu> wrote:
>> > Hi Davide
>> >
>> > I would say: ndn-cxx, NFD, and all other projects depending on ndn-cxx
>> > should be compiled exclusively in C++11 mode.
>> > We have never used C++98 mode. Currently we are using C++03 mode.
>>
>> C++98 and C++03 are the same thing.
>>
>> >
>> > It's unnecessary for ndn-cxx to keep C++03 compatibility, for the
>> > following
>> > reasons:
>> >
>> > ndn-cxx and projects depending on it are almost useless without NFD
>> > running
>> > on the same machine.
>> >
>> > "almost": ndn-cxx's Face needs NFD. Few applications don't use Face:
>> > tlvdump
>> > is an example.
>> >
>> > When NFD is running on the same machine, the platform must have a C++11
>> > compiler, so ndn-cxx and other projects can be compiled in C++11 mode.
>> > Performance benefits of C++11 (mainly from move constructor) are
>> > severely
>> > limited when ndn-cxx wants to keep C++03 compatibility.
>> >
>>
>> Personally, I agree. However I believe we were concerned about
>> third-party applications compiling and linking against ndn-cxx, and
>> that we didn't want to force C++11 onto them.
>>
>> >
>> > Yours, Junxiao
>
>
> _______________________________________________
> Nfd-dev mailing list
> Nfd-dev at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
>



More information about the Nfd-dev mailing list