Failure to compile with std::set, compiles OK with std::vector, why?

Failure to compile with std::set, compiles OK with std::vector, why?

Post by Pete Becke » Tue, 06 Jan 2009 20:31:51


On 2009-01-05 00:48:30 -0500, Triple-DES < XXXX@XXXXX.COM > said:


And that's because "non-modifying" applies to the sequence, not to the
elements. Non-modifying sequence operations do not change the order of
the elements in the sequence.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)
 
 
 

1. typedef float float4[4]; std::vector<float4>; does not compile, why?

2. Implementing GO4's Observer pattern for std::stirng and std::vector/std::map

Hi,

I want to "observe" changes to std::string and std::vector/std::map
structures. The idea being that whenever code modifies a string, or
adds/deletes a collection element, my code is notified so that I can
invalidate view objects, etc.

I know that I can wrap these data structures within my own classes and add
the observer hooks to my accessor routines. This is a tedious and
error-prone process for things like std::string with lots of methods.

I'm curious if others have found a good way to do this for STL strings and
containers. All my reading warns against sub-classing STL classes for lots
of good reasons. Are there alternatives?

Cheers
-Mark

3. Which has faster access Binary Search of std::vector or std::set ???

4. Memory footprint of std::vector<std::vector<T> >

5. Removing a vector element using std::swap and std::vector::resize.

6. Convert from std::vector<double> to std::vector<int>

7. std::transform with std::use_facet<std::ctype<char> >(std::locale()).toupper()

8. std::vector<boost::xpressive::sregex> fails to compile using gcc

9. "return delete (new int)" compile but "return delete (new std::string)" not, why?

10. "return delete (new int)" compile but "return delete (new std::string)" not, why?

11. Problem with std::stable_sort on a std::vector<gcroot<T> >

12. Operator new applies to std::vector but not std::string?

13. Error LNK2005 for std::vector<std::string> with VC.NET

14. undefined reference to `std::vector<int, std::allocator<int> >

15. std::vector, std::copy and array of int