Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2006-04-14 05:00:57

Looking at the the current Boost regression test results for uBLAS

I see we have a problem with Codewarrior as follows.

# In: ..\boost\numeric\ublas\vector.hpp
# From: ..\libs\numeric\ublas\test\test1\test11.cpp
# ----------------------------------------------------
# 702: return zero_; // arbitary return value
# Error: ^
# illegal access from 'boost::numeric::ublas::zero_vector<int>' to
protected/private member 'boost::numeric::ublas::zero_vector<int>::zero_'

Basiclly the compiler has problems with the following class definition:

    template<class T>
   class zero_vector {
        typedef T value_type;
        typedef const T &const_reference;

            const_reference operator * () const {
                return zero_;
        static const value_type zero_;

Without looking for paragraph and verse in the ISO standard this seems odd.
The accessor function operator* is 'leaking' a reference to the private zero_
member which is unusual but necessary. This is why we have accessor functions
to control such access. In this case it only leaks a 'safe' const_reference.

Any ideas from someone more knowledgable of CW if this a know bug or if there
is an easy workaround?


Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering