Boost logo

Boost :

From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2008-05-03 14:02:16

>>I'm getting really tired of writing:
>> typename point_traits<T>::coordinate_type
Bruno wrote:
>BOOST_TYPEOF(t.get<0>()) x = t.get<0>();
>BOOST_TYPEOF(t.get<1>()) y = t.get<1>();

Unfortunately almost all of the cases I have look like:

  template <orientation_3d_enum orient, typename T>
  static inline typename point_3d_traits<T>::coordinate_type
        get(const T& point) {return point.get(orient); }


  static inline void
  set(T& point, orientation_3d orient,
      typename point_3d_traits<T>::coordinate_type value) {
    if(orient == PROXIMAL) set<PROXIMAL>(point, value);
    else point_concept::set(point, orient, value); }

where typeof can't help me.

I'm sure that I'll be declaring local coordinate variables when I
rewrite some of the more involved algorithms, but the extra typing won't
bother me. For the user the coordinate type they chose to instantiate
with is known and they can just use it directly. In fact, user code (of
which there is very little in my example) looks very concise and clean.


Boost list run by bdawes at, gregod at, cpdaniel at, john at