Note that there are some explanatory texts on larger screens.

plurals
  1. POBoost Matrix in Objective C class does not compile
    primarykey
    data
    text
    <p>I need to use some boost (<code>boost/numeric/ublas/matrix.hpp</code>) in my ObjectiveC/Foundation project. I installed boost using Homebrew (an it works in C++ Xcode project).</p> <p>I use XCode 4.2.1 (clang 3.0) under Lion 10.7.2. I created and empty Foundation project, added new ObjC class and included <code>#include &lt;boost/numeric/ublas/matrix.hpp&gt;</code>. It game me numerous warnings.</p> <p>My MAMatrix.mm (.mm means ObjC++):</p> <pre><code>#import "MAMatrix.h" #include &lt;boost/numeric/ublas/matrix.hpp&gt; @implementation MAMatrix - (id)initWithSize:(NSUInteger)aSize { return [self initWithHeight:aSize width:aSize]; } - (id)initWithHeight:(NSUInteger)anHeight width:(NSUInteger)anWidth { self = [super init]; if (self) { ; } return self; } @end </code></pre> <p>I am getting</p> <pre><code>In file included from MAMatrix.mm:11: In file included from /usr/local/include/boost/numeric/ublas/matrix.hpp:16: In file included from /usr/local/include/boost/numeric/ublas/vector.hpp:19: In file included from /usr/local/include/boost/numeric/ublas/storage.hpp:26: In file included from /usr/local/include/boost/numeric/ublas/traits.hpp:24: In file included from /usr/local/include/boost/type_traits.hpp:35: In file included from /usr/local/include/boost/type_traits/has_operator.hpp:12: In file included from /usr/local/include/boost/type_traits/has_bit_and.hpp:43: /usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:157:4: error: expected expression BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make&lt;Lhs&gt;() BOOST_TT_TRAIT_OP ... ^ /usr/local/include/boost/config/suffix.hpp:431:72: note: instantiated from: # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment ^ /usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:157:121: note: instantiated from: BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make&lt;Lhs&gt;() BOOST_TT_TRAIT_OP make&lt;Rhs&gt;()),make&lt;has_operator&gt;())))=... ^ </code></pre> <p>In</p> <pre><code>template &lt; typename Lhs, typename Rhs &gt; struct operator_exists { static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make&lt;Lhs&gt;() BOOST_TT_TRAIT_OP make&lt;Rhs&gt;()),make&lt;has_operator&gt;())))==sizeof(::boost::type_traits::yes_type))); }; </code></pre> <p>I think it may be a boost issue, because STL works fine in my ObjC class.</p> <p>Thanks for help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload