From e0904a70ce39cbdba1c5cc9d607fad36b5bd4fcb Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 22 Apr 2009 21:29:42 +0000 Subject: update STL vector doc --- doc/D01_StlContainers.dox | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'doc/D01_StlContainers.dox') diff --git a/doc/D01_StlContainers.dox b/doc/D01_StlContainers.dox index 845dea156..d778e4fa0 100644 --- a/doc/D01_StlContainers.dox +++ b/doc/D01_StlContainers.dox @@ -32,17 +32,14 @@ Note that here, the 3rd parameter "std::less" is just the default value, we \section vector The case of std::vector -The situation with std::vector was even worse (explanation below) so we had to specialize it for Eigen types. The upside is that our specialization takes care of specifying the aligned allocator, so you don't need to worry about it. All you need to do is to \#include instead of (or before) \#include . +The situation with std::vector was even worse (explanation below) so we had to specialize it for the Eigen::aligned_allocator type. In practice you \b must use the Eigen::aligned_allocator (not another aligned allocator), \b and \#include . -So as soon as you have +Here is an example: \code #include +\/* ... *\/ +std::vector > \endcode -you can simply use -\code -std::vector -\endcode -without having to worry about anything. \b Explanation: The resize() method of std::vector takes a value_type argument (defaulting to value_type()). So with std::vector, some Eigen::Vector4f objects will be passed by value, which discards any alignment modifiers, so a Eigen::Vector4f can be created at an unaligned location. In order to avoid that, the only solution we saw was to specialize std::vector to make it work on a slight modification of, here, Eigen::Vector4f, that is able to deal properly with this situation. -- cgit v1.2.3