Opened 13 years ago
Closed 12 years ago
#3998 closed Patches (wontfix)
Provide light weight headers for extensibility features of BOOST_FOREACH
Reported by: | Owned by: | Eric Niebler | |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | foreach |
Version: | Boost 1.42.0 | Severity: | Optimization |
Keywords: | is_noncopyable is_lightweight_proxy | Cc: |
Description
To provide specialization as written in documentation, now users have to include the whole boost/foreach.hpp which is a somewhat heavy header, especially when BOOST_FOREACH is actually not used.
This patch extracts the extensibility interface to two new headers:
- boost/foreach_extensibility_fwd.hpp: This includes only forward declations used by the extensibility features.
- boost/foreach_extensibility.hpp: This includes also definition of the extensibility features.
Please take care to use "svn copy" from boost/foreach.hpp to create both two new headers to preserve the history.
Attachments (1)
Change History (7)
by , 13 years ago
Attachment: | foreach_separate_headers_for_extensibility.patch added |
---|
comment:1 by , 12 years ago
Status: | new → assigned |
---|
Although I don't see a need to put the implementation of is_lightweight_proxy and is_noncopyable in their own header, putting forward declarations for them in a separate header is a good suggestion.
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Although I don't see a need to put the implementation of ...
I'm sorry to have forgotten to put a link, but my another patch #3996 (for ptr_container) depends on the separation.
Could you please re-evaluate the separation?
comment:4 by , 12 years ago
What exactly is the problem you're experiencing? It's perfectly legal to specialize a template that has only been forward-declared, so the foreach_fwd.hpp should be all you need. If it's not, can you tell me what compiler/version you're using, send me the error message you're getting and code I can use to reproduce the problem? Thanks.
comment:5 by , 12 years ago
I looked more closely at your patch for #3996 and see the problem. For every instantiation of reversible_ptr_container, you are instantiating foreach::is_noncopyable to (optionally) inherit from noncopyable. This is the wrong way to do it and will lead to ODR violations when different translation units see different specializations of foreach::is_noncopyable. Instead, define a partial specialization of foreach::is_noncopyable< reversible_ptr_container<...> > as you first suggested.
comment:6 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
svn diff for trunk r60445