#532 closed Bugs (None)
multi_index/detail/unbounded.hpp causes problems in MSVC PCH
| Reported by: | dsmtoday | Owned by: | joaquintides |
|---|---|---|---|
| Milestone: | Component: | multi_index | |
| Version: | None | Severity: | |
| Keywords: | Cc: |
Description
MSVC 7.1
I integrated a multi_index into my project and have
been very happy with it. However, compile times for my
class went from milliseconds to five seconds. And
since this class is a cornerstone of my project, this
time got added to each compile.
To try and speed things up, I put this particular
class's header file in my precompiled header system.
Well, that worked great, everything compiles fast, but
when it links, there are two static objects defined in
every object file, causing conflicts, so it doesn't
link. The errors are the same this guy got.
http://lists.boost.org/boost-users/2004/07/7151.php
What I tried and what works for me, but I'm not sure is
an acceptable long-term solution, was to #define out
two lines which to my eyes appear to define static
objects. Why this is only a problem for pre-compiled
headers, I don't know. Anyway, here is what I did to
unbounded.hpp
#if !defined(_MSC_VER)
namespace{
detail::unbounded_type
unbounded_obj=detail::unbounded_type();
detail::unbounded_type& unbounded=unbounded_obj;
} /* unnamed */
#endif
Change History (5)
comment:2 by , 17 years ago
Logged In: YES user_id=1040827 JoaquÃn - Thanks for the quick reply. Your new file worked for me. No more link errors when I use the multi_index template in a pre-compiled header. Thanks again for the prompt fix! -todd-
comment:3 by , 17 years ago
| Status: | assigned → closed |
|---|
Logged In: YES user_id=911241 Fixed in CVS. Hope you're enjoying Boost.MultiIndex!
comment:4 by , 16 years ago
Logged In: YES user_id=1712657 Originator: NO I have encountered the same issue. I had also tried your solution, and it works great. Would this bug be fixed for Boost 1.34 release? Thank. ... Alan
comment:5 by , 16 years ago
Logged In: YES user_id=911241 Originator: NO Hello Alan, Yes, this problem is fixed in what will (hopefully soon) become Boost 1.34. You can check it yourself by downloading a RC_1_34 snapshot from http://engineering.meta-comm.com/boost/snapshot/boost-RC_1_34_0.tar.bz2 Best regards, JoaquÃn M López Muñoz Telefónica, Investigación y Desarrollo
Note:
See TracTickets
for help on using tickets.
