Opened 14 years ago

Closed 12 years ago

#2656 closed Patches (fixed)

Change boost::tuple::ignore to initialisation rather than assignment to allow pre-compiled headers

Reported by: Peter Myerscough-Jackopson <peter.myerscough-jackopson@…> Owned by: Joel de Guzman
Milestone: Boost 1.38.0 Component: tuple
Version: Boost 1.37.0 Severity: Optimization
Keywords: tuple::ignore Cc:

Description

In the boost tuple library, there is a variable called ignore that can be used in calls to boost::tie(...). Under C++Builder 2007 it is not possible to generate pre-compiled headers when including the appropriate headers to use boost::tie because the ignore variable is assigned on construction using the =operator rather than constructed/initialised. Although this may be about optimising build performance, and I am using an older compiler, I don't think I am requesting a negative change.

--- boost/tuple/detail/tuple_basic.hpp (Revision 46808)
+++ boost/tuple/detail/tuple_basic.hpp (working copy)
@@ -665,7 +665,7 @@
} // namespace detail

// "ignore" allows tuple positions to be ignored when using "tie".
---detail::swallow_assign const ignore = detail::swallow_assign();
+++detail::swallow_assign const ignore( detail::swallow_assign() );

// ---------------------------------------------------------------------------
// The call_traits for make_tuple

I hope this is accepted,

Yours,

Peter MJ

Change History (2)

comment:1 by Steven Watanabe, 14 years ago

This doesn't do what you think.

detail::swallow_assign const ignore( detail::swallow_assign() );

is a function declaration.

comment:2 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [62684]) Use an inline function instead of a static object for boost::tuples::ignore, avoiding problems with the ODR and Borland precompiled headers. Fixes #2656

Note: See TracTickets for help on using tickets.