Boost logo

Boost :

Subject: Re: [boost] Deprecation guidelines?
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-03-18 07:09:36


Paul A. Bristow-2 wrote:
>
>> -----Original Message-----
>> From: boost-bounces_at_[hidden]
>> [mailto:boost-bounces_at_[hidden]]
>> On Behalf Of John Maddock
>> Sent: Thursday, March 17, 2011 4:47 PM
>> To: boost_at_[hidden]
>> Subject: Re: [boost] Deprecation guidelines?
>>
>> >> Where can one find guidelines on how to deprecate things in Boost?
>> >> What is the proper way to check that code using Boost is clean?
>> >
>> > There is no standard for doing this. Right now, it's whatever each
>> > library author decides to do.
>>
>> If someone would like to volunteer to document best practice on the Wiki
>> though that would be great ;-)
>
> OK - I hope this might be within my skill set?
>
> Shall I start with a new thread asking for views?
>
> Or shall I dream up and post up a 'strawman' proposal for others to shoot
> at?
>
>

I started long time ago this
https://svn.boost.org/trac/boost/wiki/Guidelines/MaintenanceGuidelines#Deprecatingfeatures

Note that this doesn't takes care of the possibility provided by some
compilers (gcc, msvc) to deprecated a single entity as at the time I wrote
that I was not aware of the possibility.

Deprecating a file seems simple. Just add a warning when the file is include

#warning "This file is deprecated, please use another_file instead"

But deprecating parts of a file is not supported by all compilers. So the
idea is to use the file deprecation to deprecate parts of a file by
including conditionally this part.

Before

// file.hpp

...

...

After deprecation

  // file.hpp

  ...
  #if defined(BOOST_LIBX_DONT_INCLUDE_DEPRECATED_NAME)
  #include
  #endif
  ...

 // file with deprecated_part.ipp

  #warning "This file is deprecated, please use another_file instead"
  
 
Note that the .ipp files don't protect themselves as include by a protected
file.

I don't know if we can build a macros that could allow us to simplify

  #if !defined(BOOST_LIBX_DONT_INCLUDE_DEPRECATED_NAME) ...
  #include
  #endif

by

  BOOST_INCLUDE_DEPRECATED_PART(LIB, NAME)

HTH,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/Deprecation-guidelines-tp3384907p3386921.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk