Re: [eigen] STL compatible aligned_allocator + StdVector |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] STL compatible aligned_allocator + StdVector
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 9 Apr 2009 23:26:10 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=EiUW/YPUKPMXY1wmhm0B64JPSOwTdZKXV1eKNtfxST4=; b=Dt2hIKS4CvcOEfVeetd0Wgj9WKPG+9REJZiGIXtnJCMsg7rIVRY/V/axdUR9QreXtp Ymz1dDyiWI01Jl5t3eguVStkiZCGMOs8/87vX16EC6fqiwjP1d3HtilNHogHN4wtn1Z1 3aq2JTezGhr1RbHL91yxK95yZYK0AMqdOlkvU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qL1QDBpI8BzgbFggYK0a4Yk7phVnGrJrNWgaJNs+SIGnMTbjSDgyoaZtwK1EaGdIgM 7mzWomtehiDFESqAxlstVH3VisrIiaawk29kCfO6hO36HbJrwEC107kMd0p8xj9BrUh2 5b0HJ10D8kXDyGl7rlN4lr3PvfQaGnfiYXVH0=
On Thu, Apr 9, 2009 at 8:20 PM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> Hi again,
>
> It seems that the aligned_allocator is missing two important operators - see
> also here for further details
> http://blogs.msdn.com/vcblog/archive/2008/08/28/the-mallocator.aspx.
>
> bool operator!=(const aligned_allocator<T>& other) const
> {
> return !(*this == other);
> }
>
> // Returns true if and only if storage allocated from *this
> // can be deallocated from other, and vice versa.
> // Always returns true for stateless allocators.
> bool operator==(const aligned_allocator<T>& other) const
> {
> return true;
> }
thanks, patch applied.
> I think that at least the second one is required (by std::swap) in order to
> get the code from StdVector compiled under VS 2008 (vc9). Furthermore, the
> ei_workaround_msvc_std_vector might be extended by
>
> template <typename OtherT>
> inline ei_workaround_msvc_std_vector(const Eigen::MatrixBase<OtherT>& other)
> : T(other) {}
>
> This should allow the initialization via expressions like (taken from
> BVH.cpp)
>
> v.push_back(VectorType::Random());
>
> This still does not solve all problems for non MatrixBase derived types
> (e.g. AlignedBox) - simply because the constructor interface will not be
> inherited by ei_workaround_msvc_std_vector. Maybe template class
> specializations can help out.
I'm not sure to understand what's going one, the compilation errors would help.
> I won't be answering to any responses of this mail since I am on holidays!
> Wish you all a happy Easter weekend.
happy Easter to you too
> Regards,
> Hauke
>