Beman Dawes | 9 Jul 2012 17:19
Picon
Favicon
Gravatar

[config] Add BOOST_NO_RANGE_BASED_FOR macro?

I'm about to add Boost.Filesystem support for C ++11 range-based for
statements, and would like to include direct test cases for compilers
that have the feature.

Is it OK to add a BOOST_NO_RANGE_BASED_FOR macro to trunk?

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Marshall Clow | 9 Jul 2012 17:54
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 9, 2012, at 8:19 AM, Beman Dawes wrote:

> I'm about to add Boost.Filesystem support for C ++11 range-based for
> statements, and would like to include direct test cases for compilers
> that have the feature.
> 
> Is it OK to add a BOOST_NO_RANGE_BASED_FOR macro to trunk?

Two options:
1) Can you just test for c++11 support? Range based for loops are pretty basic
#if __cplusplus >= 201103L

2) If you have to add a config flag, please match the CXX11 naming scheme and call it something like
BOOST_NO_CXX11_RANGE_BASED_FOR

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists <at> gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

John Maddock | 9 Jul 2012 18:11
Favicon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

> 2) If you have to add a config flag, please match the CXX11 naming scheme 
> and call it something like
> BOOST_NO_CXX11_RANGE_BASED_FOR

+1 for that name.

Otherwise, yes please do go ahead,

John. 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Beman Dawes | 9 Jul 2012 20:34
Picon
Favicon
Gravatar

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Mon, Jul 9, 2012 at 12:11 PM, John Maddock <boost.regex <at> virgin.net> wrote:
>> 2) If you have to add a config flag, please match the CXX11 naming scheme
>> and call it something like
>> BOOST_NO_CXX11_RANGE_BASED_FOR
>
>
> +1 for that name.

I really don't want to change naming schemes this far into it. If we
go down that road, we should also rename the 28 Macros that don't use
that scheme.

Are you suggesting we should just byte the bullet and change them all?

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Marshall Clow | 9 Jul 2012 20:42
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 9, 2012, at 11:34 AM, Beman Dawes wrote:

> On Mon, Jul 9, 2012 at 12:11 PM, John Maddock <boost.regex <at> virgin.net> wrote:
>>> 2) If you have to add a config flag, please match the CXX11 naming scheme
>>> and call it something like
>>> BOOST_NO_CXX11_RANGE_BASED_FOR
>> 
>> 
>> +1 for that name.
> 
> I really don't want to change naming schemes this far into it. If we
> go down that road, we should also rename the 28 Macros that don't use
> that scheme.
> 
> Are you suggesting we should just byte the bullet and change them all?

Yes, I am.

I suggest that we do the same thing that I did for 1.50 and all the BOOST_NO_0X_* macros.
Define new ones, make the old ones have the same value as the new ones, and then, down the road, kill off the old ones.

See trunk/boost/config/suffix.hpp.

I even think that renaming all the macros (while keeping the old names around; not necessarily changing
client code) is worth doing for 1.51.

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists <at> gmail.com>

(Continue reading)

Marshall Clow | 10 Jul 2012 01:57
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 9, 2012, at 11:42 AM, Marshall Clow wrote:
> On Jul 9, 2012, at 11:34 AM, Beman Dawes wrote:
> 
>> On Mon, Jul 9, 2012 at 12:11 PM, John Maddock <boost.regex <at> virgin.net> wrote:
>>>> 2) If you have to add a config flag, please match the CXX11 naming scheme
>>>> and call it something like
>>>> BOOST_NO_CXX11_RANGE_BASED_FOR
>>> 
>>> 
>>> +1 for that name.
>> 
>> I really don't want to change naming schemes this far into it. If we
>> go down that road, we should also rename the 28 Macros that don't use
>> that scheme.
>> 
>> Are you suggesting we should just byte the bullet and change them all?
> 
> Yes, I am.
> 
> I suggest that we do the same thing that I did for 1.50 and all the BOOST_NO_0X_* macros.
> Define new ones, make the old ones have the same value as the new ones, and then, down the road, kill off the
old ones.
> 
> See trunk/boost/config/suffix.hpp.
> 
> I even think that renaming all the macros (while keeping the old names around; not necessarily changing
client code) is worth doing for 1.51.

(Putting his money where his mouth is)

(Continue reading)

Jeffrey Lee Hellrung, Jr. | 10 Jul 2012 02:15
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Mon, Jul 9, 2012 at 4:57 PM, Marshall Clow <mclow.lists <at> gmail.com> wrote:

> On Jul 9, 2012, at 11:42 AM, Marshall Clow wrote:
> > On Jul 9, 2012, at 11:34 AM, Beman Dawes wrote:
> >
> >> On Mon, Jul 9, 2012 at 12:11 PM, John Maddock <boost.regex <at> virgin.net>
> wrote:
> >>>> 2) If you have to add a config flag, please match the CXX11 naming
> scheme
> >>>> and call it something like
> >>>> BOOST_NO_CXX11_RANGE_BASED_FOR
> >>>
> >>>
> >>> +1 for that name.
> >>
> >> I really don't want to change naming schemes this far into it. If we
> >> go down that road, we should also rename the 28 Macros that don't use
> >> that scheme.
> >>
> >> Are you suggesting we should just byte the bullet and change them all?
> >
> > Yes, I am.
> >
> > I suggest that we do the same thing that I did for 1.50 and all the
> BOOST_NO_0X_* macros.
> > Define new ones, make the old ones have the same value as the new ones,
> and then, down the road, kill off the old ones.
> >
> > See trunk/boost/config/suffix.hpp.
> >
(Continue reading)

Marshall Clow | 10 Jul 2012 02:21
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 9, 2012, at 5:15 PM, Jeffrey Lee Hellrung, Jr. wrote:

> On Mon, Jul 9, 2012 at 4:57 PM, Marshall Clow <mclow.lists <at> gmail.com> wrote:
> 
>> Here's a patch vs. the trunk which renames all the macros in the table
>> "Macros that describe C++11 features not supported" (with the notable
>> exception of BOOST_NO_LONG_LONG) to have consistent names.
>> For example:
>>        BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS
>> 
>> All the old names are then #defined to be the same as the new names;
>> All the code and tests in config has been updated to use the new names.
>> All the old names have been put into the "Boost Deprecated Macros" table.
>> 
>> The goal here is no changes to client code (including code in boost
>> outside of the config library).
>> This seems to work fine on my system (Mac with gcc and clang)
>> 
>> Now Beman can define "BOOST_NO_CXX11_RANGE_BASED_FOR" and it will match
>> the style with other macros.
>> 
>> Comments?
> 
> Why, again, are we preferring inserting CXX11 versus not? I.e., why is
> BOOST_NO_CXX11_RVALUE_REFERENCES better than BOOST_NO_RVALUE_REFERENCES?

Because when the C++ committee puts out a new standard, and changes how rvalue references work, we can then
define a new flag BOOST_NO_CXX17_RVALUE_REFERENCES, and it will be easy to explain to everyone what the
differences are.

(Continue reading)

Jeffrey Lee Hellrung, Jr. | 10 Jul 2012 10:14
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Mon, Jul 9, 2012 at 5:21 PM, Marshall Clow <mclow.lists <at> gmail.com> wrote:

> On Jul 9, 2012, at 5:15 PM, Jeffrey Lee Hellrung, Jr. wrote:
>
> > On Mon, Jul 9, 2012 at 4:57 PM, Marshall Clow <mclow.lists <at> gmail.com>
> wrote:
> >
> >> Here's a patch vs. the trunk which renames all the macros in the table
> >> "Macros that describe C++11 features not supported" (with the notable
> >> exception of BOOST_NO_LONG_LONG) to have consistent names.
> >> For example:
> >>        BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS
> >>
> >> All the old names are then #defined to be the same as the new names;
> >> All the code and tests in config has been updated to use the new names.
> >> All the old names have been put into the "Boost Deprecated Macros"
> table.
> >>
> >> The goal here is no changes to client code (including code in boost
> >> outside of the config library).
> >> This seems to work fine on my system (Mac with gcc and clang)
> >>
> >> Now Beman can define "BOOST_NO_CXX11_RANGE_BASED_FOR" and it will match
> >> the style with other macros.
> >>
> >> Comments?
> >
> > Why, again, are we preferring inserting CXX11 versus not? I.e., why is
> > BOOST_NO_CXX11_RVALUE_REFERENCES better than BOOST_NO_RVALUE_REFERENCES?
>
(Continue reading)

John Maddock | 10 Jul 2012 10:03
Favicon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

>(Putting his money where his mouth is)
>
>Here's a patch vs. the trunk which renames all the macros in the table 
>"Macros that describe C++11 features not supported" (with the notable 
>exception of >BOOST_NO_LONG_LONG) to have consistent names.
>For example:
>BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS
>
>All the old names are then #defined to be the same as the new names;
>All the code and tests in config has been updated to use the new names.
>All the old names have been put into the "Boost Deprecated Macros" table.
>
>The goal here is no changes to client code (including code in boost outside 
>of the config library).
>This seems to work fine on my system (Mac with gcc and clang)
>
>Now Beman can define "BOOST_NO_CXX11_RANGE_BASED_FOR" and it will match the 
>style with other macros.
>
>Comments?

Based on casting a mark 1 eyeball over the diffs, I'm happy with that going 
in.

John. 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

(Continue reading)

Peter Dimov | 10 Jul 2012 12:18
Favicon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

>(Putting his money where his mouth is)
>
>Here's a patch vs. the trunk which renames all the macros in the table 
>"Macros that describe C++11 features not supported" (with the notable 
>exception of >BOOST_NO_LONG_LONG) to have consistent names.
>For example:
>BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS

BOOST_NO_VARIADIC_MACROS means "variadic macros are not supported". 
BOOST_NO_CXX11_VARIADIC_MACROS means "C++11 variadic macros are not 
supported, but other variadic macros may be". This is why we have 
NO_CXX11_FUNCTIONAL, for example, and not just NO_FUNCTIONAL - <functional> 
is present, but the C++11 portions aren't. 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Pyry Jahkola | 10 Jul 2012 18:02
Picon
Picon
Favicon
Gravatar

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

A slight correction but still...

On 2012-07-10 10:18:04 +0000, Peter Dimov said:

> BOOST_NO_VARIADIC_MACROS means "variadic macros are not supported".

I'm sorry, but I think this is incorrect. AFAIK, the above naming would mean:

    "Variadic macros -- the feature required by the C++ standard -- are 
not supported".

And of course, there was no such feature required before C++11.

For language extensions, there is a convention to call such macros in 
the positive form using the word "has", e.g. BOOST_HAS_VARIADIC_MACROS. 
More info: 
http://boost.org/libs/config/doc/html/boost_config/boost_macro_reference.html 

> BOOST_NO_CXX11_VARIADIC_MACROS means "C++11 variadic macros are not 
> supported, but other variadic macros may be".

This is correct, in a way, given that a future C++ standard may refine 
the variadic macros somehow.

> This is why we have NO_CXX11_FUNCTIONAL, for example, and not just 
> NO_FUNCTIONAL - <functional> is present, but the C++11 portions aren't.

This statement is correct, since the header <functional> was already 
required in C++03.

(Continue reading)

Beman Dawes | 10 Jul 2012 15:44
Picon
Favicon
Gravatar

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Tue, Jul 10, 2012 at 4:03 AM, John Maddock <boost.regex <at> virgin.net> wrote:
>> (Putting his money where his mouth is)
>>
>> Here's a patch vs. the trunk which renames all the macros in the table
>> "Macros that describe C++11 features not supported" (with the notable
>> exception of >BOOST_NO_LONG_LONG) to have consistent names.
>> For example:
>> BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS
>>
>> All the old names are then #defined to be the same as the new names;
>> All the code and tests in config has been updated to use the new names.
>> All the old names have been put into the "Boost Deprecated Macros" table.
>>
>> The goal here is no changes to client code (including code in boost
>> outside of the config library).
>> This seems to work fine on my system (Mac with gcc and clang)
>>
>> Now Beman can define "BOOST_NO_CXX11_RANGE_BASED_FOR" and it will match
>> the style with other macros.
>>
>> Comments?
>
>
> Based on casting a mark 1 eyeball over the diffs, I'm happy with that going
> in.

OK, I'm on board.

I'll wait until Marshall applies his patch before adding the
range-based-for-statement macro.
(Continue reading)

Marshall Clow | 10 Jul 2012 16:02
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?


On Jul 10, 2012, at 6:44 AM, Beman Dawes wrote:

> On Tue, Jul 10, 2012 at 4:03 AM, John Maddock <boost.regex <at> virgin.net> wrote:
>>> (Putting his money where his mouth is)
>>> 
>>> Here's a patch vs. the trunk which renames all the macros in the table
>>> "Macros that describe C++11 features not supported" (with the notable
>>> exception of >BOOST_NO_LONG_LONG) to have consistent names.
>>> For example:
>>> BOOST_NO_VARIADIC_MACROS --> BOOST_NO_CXX11_VARIADIC_MACROS
>>> 
>>> All the old names are then #defined to be the same as the new names;
>>> All the code and tests in config has been updated to use the new names.
>>> All the old names have been put into the "Boost Deprecated Macros" table.
>>> 
>>> The goal here is no changes to client code (including code in boost
>>> outside of the config library).
>>> This seems to work fine on my system (Mac with gcc and clang)
>>> 
>>> Now Beman can define "BOOST_NO_CXX11_RANGE_BASED_FOR" and it will match
>>> the style with other macros.
>>> 
>>> Comments?
>> 
>> 
>> Based on casting a mark 1 eyeball over the diffs, I'm happy with that going
>> in.
> 
> OK, I'm on board.
(Continue reading)

Beman Dawes | 10 Jul 2012 21:17
Picon
Favicon
Gravatar

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Tue, Jul 10, 2012 at 10:02 AM, Marshall Clow <mclow.lists <at> gmail.com> wrote:
>...
>
> Committed in revision 79400.

You missed the required addition of _cxx11 to the names of the test functions:-)

I fixed those at the same time as adding the
BOOST_NO_CXX11_RANGE_BASED_FOR macro. That allowed config_info and
config_test to pass on all the gcc/intel/microsoft compilers I've got
installed locally.

We need to keep an eye on the full regression tests for several days
to make sure there are no snafus.

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Jeffrey Lee Hellrung, Jr. | 10 Jul 2012 21:54
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Tue, Jul 10, 2012 at 12:17 PM, Beman Dawes <bdawes <at> acm.org> wrote:

> On Tue, Jul 10, 2012 at 10:02 AM, Marshall Clow <mclow.lists <at> gmail.com>
> wrote:
> >...
> >
> > Committed in revision 79400.
>
> You missed the required addition of _cxx11 to the names of the test
> functions:-)
>
> I fixed those at the same time as adding the
> BOOST_NO_CXX11_RANGE_BASED_FOR macro. That allowed config_info and
> config_test to pass on all the gcc/intel/microsoft compilers I've got
> installed locally.
>
> We need to keep an eye on the full regression tests for several days
> to make sure there are no snafus.
>

I thought you had changed your mind to RANGE_FOR...?

- Jeff

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Marshall Clow | 10 Jul 2012 23:48
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 10, 2012, at 12:17 PM, Beman Dawes wrote:
> On Tue, Jul 10, 2012 at 10:02 AM, Marshall Clow <mclow.lists <at> gmail.com> wrote:
>> 
>> Committed in revision 79400.
> 
> You missed the required addition of _cxx11 to the names of the test functions:-)
> 
> I fixed those at the same time as adding the
> BOOST_NO_CXX11_RANGE_BASED_FOR macro. That allowed config_info and
> config_test to pass on all the gcc/intel/microsoft compilers I've got
> installed locally.

Great!
I checked the config test this morning; but very few had cycled.

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists <at> gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Stephan T. Lavavej | 9 Jul 2012 18:14
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

[Beman Dawes] 
> Is it OK to add a BOOST_NO_RANGE_BASED_FOR macro to trunk?

[Marshall Clow]
> 1) Can you just test for c++11 support? Range based for loops are pretty basic
> #if __cplusplus >= 201103L

VC11 supports range-for, but defines __cplusplus to 199711.

STL

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Beman Dawes | 9 Jul 2012 20:28
Picon
Favicon
Gravatar

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Mon, Jul 9, 2012 at 11:54 AM, Marshall Clow <mclow.lists <at> gmail.com> wrote:
> On Jul 9, 2012, at 8:19 AM, Beman Dawes wrote:
>
>> I'm about to add Boost.Filesystem support for C ++11 range-based for
>> statements, and would like to include direct test cases for compilers
>> that have the feature.
>>
>> Is it OK to add a BOOST_NO_RANGE_BASED_FOR macro to trunk?
>
> Two options:
> 1) Can you just test for c++11 support? Range based for loops are pretty basic
> #if __cplusplus >= 201103L

Range-base for statement support is like all the other C++0x features
- they are being added to most compilers release by release. None of
the major vendors seem to be waiting until all features are ready in
their compilers.

> 2) If you have to add a config flag, please match the CXX11 naming scheme and call it something like
> BOOST_NO_CXX11_RANGE_BASED_FOR

We are using the BOOST_NO_CXX11_ scheme for header files only. None of
the 28 feature macros we already have use a BOOST_NO_CXX11_ prefix.

See http://www.boost.org/doc/libs/1_50_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
(Continue reading)

Marshall Clow | 9 Jul 2012 20:37
Picon

Re: [config] Add BOOST_NO_RANGE_BASED_FOR macro?

On Jul 9, 2012, at 11:28 AM, Beman Dawes wrote:

>> 2) If you have to add a config flag, please match the CXX11 naming scheme and call it something like
>> BOOST_NO_CXX11_RANGE_BASED_FOR
> 
> We are using the BOOST_NO_CXX11_ scheme for header files only. None of
> the 28 feature macros we already have use a BOOST_NO_CXX11_ prefix.
> 
> Seehttp://www.boost.org/doc/libs/1_50_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported

Well, shame on us.

I could argue about
	BOOST_NO_CXX11_SMART_PTR
	BOOST_NO_CXX11_ALLOCATOR
	BOOST_NO_CXX11_ATOMIC_SMART_PTR

but those are "related to" header files.

IM(NS)HO, these should all be BOOST_NO_CXX11 macros.
For example, BOOST_NO_NULLPTR should be BOOST_NO_CXX11_NULLPTR

(but we're not going to change that today)

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists <at> gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki
(Continue reading)


Gmane