Miles Bader skrev:
I tried changing some of my code that used std::vector
to using boost::ptr_vector<foo> (to get automatic deallocation and the slightly nicer syntax), but the resulting compiled code seems oddly bloated compared to the original code using std::vector. My intuition is that the two should generally compile to largely equivalent object code, except where there's a necessary functional difference.
Are you referring to a debug build? If so, why do you care about it? What compiler? 1.34 introduced a macro for tuning all the exceptions into asserts.
Does it have a "bloat" reputation?
Well, there has been some indications that the void* implementation leads to slightly slower code. OTOH, the void* implementation was made exactly to avoid bloat on compilers that generate new code for every T*. -Thorsten