public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Please help with these two errors
@ 2008-01-14 13:09 mahmoodn
  2008-01-14 15:45 ` John (Eljay) Love-Jensen
  0 siblings, 1 reply; 14+ messages in thread
From: mahmoodn @ 2008-01-14 13:09 UTC (permalink / raw)
  To: gcc-help


Hi,
I have defined a class named "vertex_feature_2":

class Vertex_feature_2
{
public:
    enum Type
    {
      CIRCULAR,
      CHAIN
    };

private:
    int                     ver_id;   // The ID of the coresponding vertex.
public:
    /*!
     * Default constrcutor.
     */
    Vertex_feature_2 () :
      ver_id (-1)
    {}

    /*!
     * Destructor.
     */
    virtual ~Vertex_feature_2 ()
    {}

    /*!
     * Get the feature type.
     */
    virtual Vertex_feature_2::Type type () const = 0;  // ERROR1&-(

   
and also there is a class "circular_arc_2" that is derived from
"vertex_feature_2":
   
class Circular_arc_2 : public Vertex_feature_2
{
    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);  //ERROR2&-(
    }
}

there are two problems:confused::confused::
error: `Type' declared as a `virtual' field
error: `CIRCULAR' was not declared in this scope

how can I resolve them?:working:
Thanks,
 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14787660.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-14 13:09 Please help with these two errors mahmoodn
@ 2008-01-14 15:45 ` John (Eljay) Love-Jensen
  2008-01-15  8:30   ` mahmoodn
  0 siblings, 1 reply; 14+ messages in thread
From: John (Eljay) Love-Jensen @ 2008-01-14 15:45 UTC (permalink / raw)
  To: mahmoodn, gcc-help

Hi mahmoodn,

class Circular_arc_2 : public Vertex_feature_2
{
    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);
    }
}

Why do you have "typename" here?

--Eljay

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-14 15:45 ` John (Eljay) Love-Jensen
@ 2008-01-15  8:30   ` mahmoodn
  2008-01-15 15:17     ` John (Eljay) Love-Jensen
  2008-01-16  0:45     ` Jonathan Saxton
  0 siblings, 2 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-15  8:30 UTC (permalink / raw)
  To: gcc-help


>Why do you have "typename" here?

Hi,
realy I don't know!! I did not write this code but it could be compiled with
previous versions of gcc.

shall I remove typename?:confused:


John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
> class Circular_arc_2 : public Vertex_feature_2
> {
>     virtual typename Vertex_feature_2::Type type () const
>     {
>       return (CIRCULAR);
>     }
> }
> 
> Why do you have "typename" here?
> 
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14796132.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-15  8:30   ` mahmoodn
@ 2008-01-15 15:17     ` John (Eljay) Love-Jensen
  2008-01-16 12:05       ` mahmoodn
  2008-01-16  0:45     ` Jonathan Saxton
  1 sibling, 1 reply; 14+ messages in thread
From: John (Eljay) Love-Jensen @ 2008-01-15 15:17 UTC (permalink / raw)
  To: mahmoodn, gcc-help

Hi mahmoodn,

> shall I remove typename?:confused:

I would, since it violates C++ to have it there.

I'm surprised the warning message didn't mention something to that effect.  (It did with my GCC.)

As GCC's C++ moves forward from version to version, it tends to become more and more compliant with ISO 14882.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-15  8:30   ` mahmoodn
  2008-01-15 15:17     ` John (Eljay) Love-Jensen
@ 2008-01-16  0:45     ` Jonathan Saxton
  2008-01-16 12:31       ` mahmoodn
  1 sibling, 1 reply; 14+ messages in thread
From: Jonathan Saxton @ 2008-01-16  0:45 UTC (permalink / raw)
  To: gcc-help


Typename keyword is ONLY valid within a template.  Your class declaration is
not a template.

If it compiled before then it shouldn't have.


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of mahmoodn
Sent: 14 January, 2008 01:45
To: gcc-help@gcc.gnu.org
Subject: RE: Please help with these two errors


>Why do you have "typename" here?

Hi,
realy I don't know!! I did not write this code but it could be compiled with
previous versions of gcc.

shall I remove typename?:confused:


John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
> class Circular_arc_2 : public Vertex_feature_2
> {
>     virtual typename Vertex_feature_2::Type type () const
>     {
>       return (CIRCULAR);
>     }
> }
> 
> Why do you have "typename" here?
> 
> --Eljay
> 
> 

-- 
View this message in context:
http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14796132.
html
Sent from the gcc - Help mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-15 15:17     ` John (Eljay) Love-Jensen
@ 2008-01-16 12:05       ` mahmoodn
  0 siblings, 0 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-16 12:05 UTC (permalink / raw)
  To: gcc-help


>I would, since it violates C++ to have it there.

AND 

>Typename keyword is ONLY valid within a template.  Your class declaration
is 
>not a template. 

>If it compiled before then it shouldn't have. 


Hi there,
I remove the "typename", but now it says another error:,(.

../include/CGAL/VVc_diagram_2.h:239: warning: ISO C++ forbids declaration of
`Type' with no type
../include/CGAL/VVc_diagram_2.h:239: error: cannot declare member
`CGAL::VVc_diagram_2<Traits_, AppKernel_>::Vertex_feature_2::Type' within
`CGAL::VVc_diagram_2<Traits_, AppKernel_>::Circular_arc_2'
../include/CGAL/VVc_diagram_2.h:239: error: expected `;' before "type"


By the way, what about the first error?:-(



John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
>> shall I remove typename?:confused:
> 
> I would, since it violates C++ to have it there.
> 
> I'm surprised the warning message didn't mention something to that effect. 
> (It did with my GCC.)
> 
> As GCC's C++ moves forward from version to version, it tends to become
> more and more compliant with ISO 14882.
> 
> HTH,
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14834958.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16  0:45     ` Jonathan Saxton
@ 2008-01-16 12:31       ` mahmoodn
  2008-01-16 13:18         ` John (Eljay) Love-Jensen
  0 siblings, 1 reply; 14+ messages in thread
From: mahmoodn @ 2008-01-16 12:31 UTC (permalink / raw)
  To: gcc-help


Thaks for your reply, but it did not fixed yet as I post in reply to Eljay.

How about the first problem?



Jonathan Saxton wrote:
> 
> 
> Typename keyword is ONLY valid within a template.  Your class declaration
> is
> not a template.
> 
> If it compiled before then it shouldn't have.
> 
> 
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of mahmoodn
> Sent: 14 January, 2008 01:45
> To: gcc-help@gcc.gnu.org
> Subject: RE: Please help with these two errors
> 
> 
>>Why do you have "typename" here?
> 
> Hi,
> realy I don't know!! I did not write this code but it could be compiled
> with
> previous versions of gcc.
> 
> shall I remove typename?:confused:
> 
> 
> John (Eljay) Love-Jensen wrote:
>> 
>> Hi mahmoodn,
>> 
>> class Circular_arc_2 : public Vertex_feature_2
>> {
>>     virtual typename Vertex_feature_2::Type type () const
>>     {
>>       return (CIRCULAR);
>>     }
>> }
>> 
>> Why do you have "typename" here?
>> 
>> --Eljay
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14796132.
> html
> Sent from the gcc - Help mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14834964.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 12:31       ` mahmoodn
@ 2008-01-16 13:18         ` John (Eljay) Love-Jensen
  2008-01-16 14:27           ` mahmoodn
  0 siblings, 1 reply; 14+ messages in thread
From: John (Eljay) Love-Jensen @ 2008-01-16 13:18 UTC (permalink / raw)
  To: mahmoodn, gcc-help

Hi mahmoodn,

> How about the first problem?

From your code snippet, I was unable to reproduce the first problem you inquired about.  No error, or warning.

I need small compilable code example that produces the error.  Does the code snippet produce the error for you?

Sincerely,
--Eljay

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 13:18         ` John (Eljay) Love-Jensen
@ 2008-01-16 14:27           ` mahmoodn
  2008-01-16 14:27             ` John (Eljay) Love-Jensen
                               ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-16 14:27 UTC (permalink / raw)
  To: gcc-help


>I need small compilable code example that produces the error.  Does the code
snippet produce the error >for you?

The file is a littile bit lengthy, I can post it here. Before that here is a
larger snippet of th class.


template <class Traits_, class AppKernel_>
class VVc_diagram_2
{
public:

  typedef Traits_                                   Traits_2;
  typedef AppKernel_                                Approx_kernel;

  // Define types from the rational kernel.
  typedef typename Traits_2::Rat_kernel             Rat_kernel;
  typedef typename Traits_2::Rational               Rational;

private:

  typedef Partial_polygon_Voronoi_diagram_2<Traits_2>  Partial_pvd_2;
  typedef typename Partial_pvd_2::Arc_const_iterator  
Pvd_arc_const_iterator;

  typedef typename Partial_pvd_2::Rat_segment_2        Rat_segment_2;

public:

  typedef typename Partial_pvd_2::Rat_point_2        Rat_point_2;
  typedef typename Partial_pvd_2::Rat_polygon_2      Rat_polygon_2;


  typedef typename Approx_kernel::Point_2            App_point_2;
  typedef typename Approx_kernel::Segment_2          App_segment_2;
  typedef std::list<App_segment_2>                   App_segments_list_2;

private:

  // Define the polygon clearance offsetting and the objects from the
  // algebraic kernel.
  typedef Polygon_clearance_offsetting_2<Traits_2>   PCO_2;

public:

  typedef typename PCO_2::Alg_point_2               Alg_point_2;

private:

  typedef typename Traits_2::Curve_2                Conic_arc_2;
  typedef typename Traits_2::X_monotone_curve_2     X_monotone_conic_arc_2;
  typedef typename PCO_2::Offset_arc_2              Offset_arc_2;
  typedef typename PCO_2::Algebraic                 Algebraic;
  typedef typename PCO_2::Alg_kernel                Alg_kernel;
  typedef std::list<X_monotone_conic_arc_2>         X_conic_arcs_list_2;
  typedef std::list<Offset_arc_2>                   Offset_arcs_list_2;

  typedef typename PCO_2::Rat_polygon_clearance_2   Polygon_clearance_2;
  typedef std::vector<Polygon_clearance_2>          Polygon_clrs_vec_2;

  typedef std::multimap<Polygon_feature_2, 
                        X_monotone_conic_arc_2, 
                        Less_polygon_feature_2>        Polygon_features_map;
  typedef typename Polygon_features_map::value_type    Pf_map_entry;
  typedef typename Polygon_features_map::iterator      Pf_map_iterator;

  // Define the circle-tangents class.
//  typedef Circle_tangents_2<Traits_2>                  Circle_tangents_2;

  // Define the approximated kernel objects.
  typedef typename Approx_kernel::Circle_2             App_circle_2;
  typedef typename Approx_kernel::Circular_arc_2       App_circular_arc_2;

  /*!
   * \enum Edge types.
   */
  enum Arc_type
  {
    MINKOWSKI,
    VORONOI
  };
 
  /*!
   * \struct Representation of the data attached to an arc.
   */
  struct Data
  {
    Arc_type         type;       // The arc type.
    union
    {
      const Polygon_feature_2                  *feature;     
                                          // For MINKOWSKI arcs.
      const typename Partial_pvd_2::Arc_data_2 *data;
                                          // For VORONOI arcs.
    }                pointer;
  };

  struct Copy_data
  {
    const Data& operator() (const Data& d1, const Data& ) const
    {
      return (d1);
    }
  }; 

  typedef Arr_curve_data_traits_2<Traits_2, Data, 
                                  Copy_data,
                                  Data>                Data_traits_2;
  typedef typename Data_traits_2::Curve_2              Curve_2;
  typedef typename Data_traits_2::X_monotone_curve_2   X_monotone_curve_2;

  typedef Arr_extended_dcel<Data_traits_2,
                            int, int, bool>            Dcel;
  typedef Arrangement_2<Data_traits_2, Dcel>           Arrangement_2;

  typedef typename Arrangement_2::Halfedge_handle       Halfedge_handle;
//  typedef typename Arrangement_2::Halfedge_const_handle
Halfedge_const_handle;
  typedef typename Arrangement_2::Face_const_handle     Face_const_handle;

  typedef typename Arrangement_2::Vertex_iterator       Vertex_iterator;
/*  typedef typename Arrangement_2::Halfedge_const_iterator
                                                    
Halfedge_const_iterator;*/
  typedef typename Arrangement_2::Edge_const_iterator
                                                     Edge_const_iterator;
  typedef typename Arrangement_2::Halfedge_around_vertex_circulator  
                                           
Halfedge_around_vertex_circulator;

  /*!
   * \class Representation of a feature associated with vertex in the 
   *        VV(c) diagram.
   */
  class Vertex_feature_2
  {
  public:

    enum Type
    {
      CIRCULAR,
      CHAIN
    };

  private:

    int                     ver_id;   // The ID of the coresponding vertex.

  public:

    /*!
     * Default constrcutor.
     */
    Vertex_feature_2 () :
      ver_id (-1)
    {}

    /*!
     * Destructor.
     */
    virtual ~Vertex_feature_2 ()
    {}

    /*!
     * Get the feature type.
     */
    virtual Vertex_feature_2::Type type () const = 0;

    /*!
     * Get the vertex ID.
     */
    int vertex_id () const
    {
      return (ver_id);
    }

    /*!
     * Set the vertex ID.
     */
    void set_vertex_id (const int& id)
    {
      ver_id = id;
      return;
    }
  };
  /*!
   * \class Representation of a circular arc associated with a vertex in
   *        the VV(c) diagram.
   */
  class Circular_arc_2 : public Vertex_feature_2
  {
  private:

    Rat_point_2             _c;       // The center of the supporting
circle.
    Alg_point_2             _s;       // The source point of the arc.
    Alg_point_2             _t;       // The target point of the arc.
    Orientation             _or;      // The arc's orientation.

  public:

    /*! Default constructor. */
    Circular_arc_2 () :
      _or (COLLINEAR)
    {}

    /*!
     * Constructor.
     * \param c The center of the supporting circle.
     * \param s The source point of the circular arc.
     * \param t The target point of the circular arc.
     * \param orient The orientation of the circular arc.
     */
    Circular_arc_2 (const Rat_point_2& c,
                    const Alg_point_2& s, const Alg_point_2& t,
                    const Orientation& orient) :
      _c (c),
      _s (s),
      _t (t),
      _or (orient)
    {}

    /*!
     * Get the feature type.
     */
    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);
    }

    /*!
     * Get the center of the supporting circle.
     */
    const Rat_point_2& center () const
    {
      return (_c);
    }

    /*!
     * Get the source point of the circular arc.
     */
    const Alg_point_2& source () const
    {
      return (_s);
    }

    /*!
     * Get the target point of the circular arc.
     */
    const Alg_point_2& target () const
    {
      return (_t);
    }

    /*!
     * Get the orientation of the circular arc.
     */
    Orientation orientation () const
    {
      return (_or);
    }

  };
...
...
}

Thanks in advance...



John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
>> How about the first problem?
> 
> From your code snippet, I was unable to reproduce the first problem you
> inquired about.  No error, or warning.
> 
> I need small compilable code example that produces the error.  Does the
> code snippet produce the error for you?
> 
> Sincerely,
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14841429.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 14:27           ` mahmoodn
@ 2008-01-16 14:27             ` John (Eljay) Love-Jensen
  2008-01-16 14:42             ` John (Eljay) Love-Jensen
                               ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: John (Eljay) Love-Jensen @ 2008-01-16 14:27 UTC (permalink / raw)
  To: mahmoodn, gcc-help

Hi mahmoodn,

> The file is a littile bit lengthy, I can post it here. Before that here is a larger snippet of th class.

Thank you for posting the code snippet.

Unfortunately, the code snippet you posted does not generate the problem, rather it generates 117 errors (plus, as given, was not compilable, as it required some syntactical cleanup at the end).

Please provide a compilable code snippet that reproduces the one error you are asking about.

Please test compile the code snippet you are submitting, before you submit it, to insure that it generates the error you are inquiring about.

Thanks,
--Eljay

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 14:27           ` mahmoodn
  2008-01-16 14:27             ` John (Eljay) Love-Jensen
@ 2008-01-16 14:42             ` John (Eljay) Love-Jensen
  2008-01-17  0:56               ` mahmoodn
  2008-01-16 15:34             ` mahmoodn
  2008-01-16 15:55             ` mahmoodn
  3 siblings, 1 reply; 14+ messages in thread
From: John (Eljay) Love-Jensen @ 2008-01-16 14:42 UTC (permalink / raw)
  To: mahmoodn, gcc-help

Hi mahmoodn,

In your code snippet, this Circular_arc_2 routine is malformed C++.

    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);
    }

Change it to this:

    virtual typename VVc_diagram_2<Traits_, AppKernel_>::Vertex_feature_2::Type type () const
    {
      return Vertex_feature_2::CIRCULAR;
    }

Or introduce a helpful typedef in Circular_arc_2:

    typedef typename VVc_diagram_2<Traits_, AppKernel_>::Vertex_feature_2::Type Type;

    virtual Type type () const
    {
      return Vertex_feature_2::CIRCULAR;
    }

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 14:27           ` mahmoodn
  2008-01-16 14:27             ` John (Eljay) Love-Jensen
  2008-01-16 14:42             ` John (Eljay) Love-Jensen
@ 2008-01-16 15:34             ` mahmoodn
  2008-01-16 15:55             ` mahmoodn
  3 siblings, 0 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-16 15:34 UTC (permalink / raw)
  To: gcc-help


>I need small compilable code example that produces the error.  Does the code
snippet produce the error >for you?

The file is a littile bit lengthy, I can post it here. Before that here is a
larger snippet of th class.


template <class Traits_, class AppKernel_>
class VVc_diagram_2
{
public:

  typedef Traits_                                   Traits_2;
  typedef AppKernel_                                Approx_kernel;

  // Define types from the rational kernel.
  typedef typename Traits_2::Rat_kernel             Rat_kernel;
  typedef typename Traits_2::Rational               Rational;

private:

  typedef Partial_polygon_Voronoi_diagram_2<Traits_2>  Partial_pvd_2;
  typedef typename Partial_pvd_2::Arc_const_iterator  
Pvd_arc_const_iterator;

  typedef typename Partial_pvd_2::Rat_segment_2        Rat_segment_2;

public:

  typedef typename Partial_pvd_2::Rat_point_2        Rat_point_2;
  typedef typename Partial_pvd_2::Rat_polygon_2      Rat_polygon_2;


  typedef typename Approx_kernel::Point_2            App_point_2;
  typedef typename Approx_kernel::Segment_2          App_segment_2;
  typedef std::list<App_segment_2>                   App_segments_list_2;

private:

  // Define the polygon clearance offsetting and the objects from the
  // algebraic kernel.
  typedef Polygon_clearance_offsetting_2<Traits_2>   PCO_2;

public:

  typedef typename PCO_2::Alg_point_2               Alg_point_2;

private:

  typedef typename Traits_2::Curve_2                Conic_arc_2;
  typedef typename Traits_2::X_monotone_curve_2     X_monotone_conic_arc_2;
  typedef typename PCO_2::Offset_arc_2              Offset_arc_2;
  typedef typename PCO_2::Algebraic                 Algebraic;
  typedef typename PCO_2::Alg_kernel                Alg_kernel;
  typedef std::list<X_monotone_conic_arc_2>         X_conic_arcs_list_2;
  typedef std::list<Offset_arc_2>                   Offset_arcs_list_2;

  typedef typename PCO_2::Rat_polygon_clearance_2   Polygon_clearance_2;
  typedef std::vector<Polygon_clearance_2>          Polygon_clrs_vec_2;

  typedef std::multimap<Polygon_feature_2, 
                        X_monotone_conic_arc_2, 
                        Less_polygon_feature_2>        Polygon_features_map;
  typedef typename Polygon_features_map::value_type    Pf_map_entry;
  typedef typename Polygon_features_map::iterator      Pf_map_iterator;

  // Define the circle-tangents class.
//  typedef Circle_tangents_2<Traits_2>                  Circle_tangents_2;

  // Define the approximated kernel objects.
  typedef typename Approx_kernel::Circle_2             App_circle_2;
  typedef typename Approx_kernel::Circular_arc_2       App_circular_arc_2;

  /*!
   * \enum Edge types.
   */
  enum Arc_type
  {
    MINKOWSKI,
    VORONOI
  };
 
  /*!
   * \struct Representation of the data attached to an arc.
   */
  struct Data
  {
    Arc_type         type;       // The arc type.
    union
    {
      const Polygon_feature_2                  *feature;     
                                          // For MINKOWSKI arcs.
      const typename Partial_pvd_2::Arc_data_2 *data;
                                          // For VORONOI arcs.
    }                pointer;
  };

  struct Copy_data
  {
    const Data& operator() (const Data& d1, const Data& ) const
    {
      return (d1);
    }
  }; 

  typedef Arr_curve_data_traits_2<Traits_2, Data, 
                                  Copy_data,
                                  Data>                Data_traits_2;
  typedef typename Data_traits_2::Curve_2              Curve_2;
  typedef typename Data_traits_2::X_monotone_curve_2   X_monotone_curve_2;

  typedef Arr_extended_dcel<Data_traits_2,
                            int, int, bool>            Dcel;
  typedef Arrangement_2<Data_traits_2, Dcel>           Arrangement_2;

  typedef typename Arrangement_2::Halfedge_handle       Halfedge_handle;
//  typedef typename Arrangement_2::Halfedge_const_handle
Halfedge_const_handle;
  typedef typename Arrangement_2::Face_const_handle     Face_const_handle;

  typedef typename Arrangement_2::Vertex_iterator       Vertex_iterator;
/*  typedef typename Arrangement_2::Halfedge_const_iterator
                                                    
Halfedge_const_iterator;*/
  typedef typename Arrangement_2::Edge_const_iterator
                                                     Edge_const_iterator;
  typedef typename Arrangement_2::Halfedge_around_vertex_circulator  
                                           
Halfedge_around_vertex_circulator;

  /*!
   * \class Representation of a feature associated with vertex in the 
   *        VV(c) diagram.
   */
  class Vertex_feature_2
  {
  public:

    enum Type
    {
      CIRCULAR,
      CHAIN
    };

  private:

    int                     ver_id;   // The ID of the coresponding vertex.

  public:

    /*!
     * Default constrcutor.
     */
    Vertex_feature_2 () :
      ver_id (-1)
    {}

    /*!
     * Destructor.
     */
    virtual ~Vertex_feature_2 ()
    {}

    /*!
     * Get the feature type.
     */
    virtual Vertex_feature_2::Type type () const = 0;

    /*!
     * Get the vertex ID.
     */
    int vertex_id () const
    {
      return (ver_id);
    }

    /*!
     * Set the vertex ID.
     */
    void set_vertex_id (const int& id)
    {
      ver_id = id;
      return;
    }
  };
  /*!
   * \class Representation of a circular arc associated with a vertex in
   *        the VV(c) diagram.
   */
  class Circular_arc_2 : public Vertex_feature_2
  {
  private:

    Rat_point_2             _c;       // The center of the supporting
circle.
    Alg_point_2             _s;       // The source point of the arc.
    Alg_point_2             _t;       // The target point of the arc.
    Orientation             _or;      // The arc's orientation.

  public:

    /*! Default constructor. */
    Circular_arc_2 () :
      _or (COLLINEAR)
    {}

    /*!
     * Constructor.
     * \param c The center of the supporting circle.
     * \param s The source point of the circular arc.
     * \param t The target point of the circular arc.
     * \param orient The orientation of the circular arc.
     */
    Circular_arc_2 (const Rat_point_2& c,
                    const Alg_point_2& s, const Alg_point_2& t,
                    const Orientation& orient) :
      _c (c),
      _s (s),
      _t (t),
      _or (orient)
    {}

    /*!
     * Get the feature type.
     */
    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);
    }

    /*!
     * Get the center of the supporting circle.
     */
    const Rat_point_2& center () const
    {
      return (_c);
    }

    /*!
     * Get the source point of the circular arc.
     */
    const Alg_point_2& source () const
    {
      return (_s);
    }

    /*!
     * Get the target point of the circular arc.
     */
    const Alg_point_2& target () const
    {
      return (_t);
    }

    /*!
     * Get the orientation of the circular arc.
     */
    Orientation orientation () const
    {
      return (_or);
    }

  };
...
...
}

Thanks in advance...



John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
>> How about the first problem?
> 
> From your code snippet, I was unable to reproduce the first problem you
> inquired about.  No error, or warning.
> 
> I need small compilable code example that produces the error.  Does the
> code snippet produce the error for you?
> 
> Sincerely,
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14841429.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 14:27           ` mahmoodn
                               ` (2 preceding siblings ...)
  2008-01-16 15:34             ` mahmoodn
@ 2008-01-16 15:55             ` mahmoodn
  3 siblings, 0 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-16 15:55 UTC (permalink / raw)
  To: gcc-help


>I need small compilable code example that produces the error.  Does the code
snippet produce the error >for you?

The file is a littile bit lengthy, I can post it here. Before that here is a
larger snippet of th class.

template <class Traits_, class AppKernel_>
class VVc_diagram_2
{
public:

  typedef Traits_                                   Traits_2;
  typedef AppKernel_                                Approx_kernel;

  // Define types from the rational kernel.
  typedef typename Traits_2::Rat_kernel             Rat_kernel;
  typedef typename Traits_2::Rational               Rational;

private:

  typedef Partial_polygon_Voronoi_diagram_2<Traits_2>  Partial_pvd_2;
  typedef typename Partial_pvd_2::Arc_const_iterator  
Pvd_arc_const_iterator;

  typedef typename Partial_pvd_2::Rat_segment_2        Rat_segment_2;

public:

  typedef typename Partial_pvd_2::Rat_point_2        Rat_point_2;
  typedef typename Partial_pvd_2::Rat_polygon_2      Rat_polygon_2;


  typedef typename Approx_kernel::Point_2            App_point_2;
  typedef typename Approx_kernel::Segment_2          App_segment_2;
  typedef std::list<App_segment_2>                   App_segments_list_2;

private:

  // Define the polygon clearance offsetting and the objects from the
  // algebraic kernel.
  typedef Polygon_clearance_offsetting_2<Traits_2>   PCO_2;

public:

  typedef typename PCO_2::Alg_point_2               Alg_point_2;

private:

  typedef typename Traits_2::Curve_2                Conic_arc_2;
  typedef typename Traits_2::X_monotone_curve_2     X_monotone_conic_arc_2;
  typedef typename PCO_2::Offset_arc_2              Offset_arc_2;
  typedef typename PCO_2::Algebraic                 Algebraic;
  typedef typename PCO_2::Alg_kernel                Alg_kernel;
  typedef std::list<X_monotone_conic_arc_2>         X_conic_arcs_list_2;
  typedef std::list<Offset_arc_2>                   Offset_arcs_list_2;

  typedef typename PCO_2::Rat_polygon_clearance_2   Polygon_clearance_2;
  typedef std::vector<Polygon_clearance_2>          Polygon_clrs_vec_2;

  typedef std::multimap<Polygon_feature_2, 
                        X_monotone_conic_arc_2, 
                        Less_polygon_feature_2>        Polygon_features_map;
  typedef typename Polygon_features_map::value_type    Pf_map_entry;
  typedef typename Polygon_features_map::iterator      Pf_map_iterator;

  // Define the circle-tangents class.
//  typedef Circle_tangents_2<Traits_2>                  Circle_tangents_2;

  // Define the approximated kernel objects.
  typedef typename Approx_kernel::Circle_2             App_circle_2;
  typedef typename Approx_kernel::Circular_arc_2       App_circular_arc_2;

  /*!
   * \enum Edge types.
   */
  enum Arc_type
  {
    MINKOWSKI,
    VORONOI
  };
 
  /*!
   * \struct Representation of the data attached to an arc.
   */
  struct Data
  {
    Arc_type         type;       // The arc type.
    union
    {
      const Polygon_feature_2                  *feature;     
                                          // For MINKOWSKI arcs.
      const typename Partial_pvd_2::Arc_data_2 *data;
                                          // For VORONOI arcs.
    }                pointer;
  };

  struct Copy_data
  {
    const Data& operator() (const Data& d1, const Data& ) const
    {
      return (d1);
    }
  }; 

  typedef Arr_curve_data_traits_2<Traits_2, Data, 
                                  Copy_data,
                                  Data>                Data_traits_2;
  typedef typename Data_traits_2::Curve_2              Curve_2;
  typedef typename Data_traits_2::X_monotone_curve_2   X_monotone_curve_2;

  typedef Arr_extended_dcel<Data_traits_2,
                            int, int, bool>            Dcel;
  typedef Arrangement_2<Data_traits_2, Dcel>           Arrangement_2;

  typedef typename Arrangement_2::Halfedge_handle       Halfedge_handle;
  typedef typename Arrangement_2::Face_const_handle     Face_const_handle;

  typedef typename Arrangement_2::Vertex_iterator       Vertex_iterator;
  typedef typename Arrangement_2::Edge_const_iterator
                                                     Edge_const_iterator;
  typedef typename Arrangement_2::Halfedge_around_vertex_circulator  
                                           
Halfedge_around_vertex_circulator;

  /*!
   * \class Representation of a feature associated with vertex in the 
   *        VV(c) diagram.
   */
  class Vertex_feature_2
  {
  public:

    enum Type
    {
      CIRCULAR,
      CHAIN
    };

  private:

    int                     ver_id;   // The ID of the coresponding vertex.

  public:

    /*!
     * Default constrcutor.
     */
    Vertex_feature_2 () :
      ver_id (-1)
    {}

    /*!
     * Destructor.
     */
    virtual ~Vertex_feature_2 ()
    {}

    /*!
     * Get the feature type.
     */
    virtual Vertex_feature_2::Type type () const = 0;

    /*!
     * Get the vertex ID.
     */
    int vertex_id () const
    {
      return (ver_id);
    }

    /*!
     * Set the vertex ID.
     */
    void set_vertex_id (const int& id)
    {
      ver_id = id;
      return;
    }
  };
  /*!
   * \class Representation of a circular arc associated with a vertex in
   *        the VV(c) diagram.
   */
  class Circular_arc_2 : public Vertex_feature_2
  {
  private:

    Rat_point_2             _c;       // The center of the supporting
circle.
    Alg_point_2             _s;       // The source point of the arc.
    Alg_point_2             _t;       // The target point of the arc.
    Orientation             _or;      // The arc's orientation.

  public:

    /*! Default constructor. */
    Circular_arc_2 () :
      _or (COLLINEAR)
    {}

    /*!
     * Constructor.
     * \param c The center of the supporting circle.
     * \param s The source point of the circular arc.
     * \param t The target point of the circular arc.
     * \param orient The orientation of the circular arc.
     */
    Circular_arc_2 (const Rat_point_2& c,
                    const Alg_point_2& s, const Alg_point_2& t,
                    const Orientation& orient) :
      _c (c),
      _s (s),
      _t (t),
      _or (orient)
    {}

    /*!
     * Get the feature type.
     */
    virtual typename Vertex_feature_2::Type type () const
    {
      return (CIRCULAR);
    }

    /*!
     * Get the center of the supporting circle.
     */
    const Rat_point_2& center () const
    {
      return (_c);
    }

    /*!
     * Get the source point of the circular arc.
     */
    const Alg_point_2& source () const
    {
      return (_s);
    }

    /*!
     * Get the target point of the circular arc.
     */
    const Alg_point_2& target () const
    {
      return (_t);
    }

    /*!
     * Get the orientation of the circular arc.
     */
    Orientation orientation () const
    {
      return (_or);
    }

  };
...
...
}

Thanks in advance...



John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
>> How about the first problem?
> 
> From your code snippet, I was unable to reproduce the first problem you
> inquired about.  No error, or warning.
> 
> I need small compilable code example that produces the error.  Does the
> code snippet produce the error for you?
> 
> Sincerely,
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14841429.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Please help with these two errors
  2008-01-16 14:42             ` John (Eljay) Love-Jensen
@ 2008-01-17  0:56               ` mahmoodn
  0 siblings, 0 replies; 14+ messages in thread
From: mahmoodn @ 2008-01-17  0:56 UTC (permalink / raw)
  To: gcc-help


>Change it to this:
>    virtual typename VVc_diagram_2<Traits_,
> AppKernel_>::Vertex_feature_2::Type type () const
>    {
>      return Vertex_feature_2::CIRCULAR;
>    }

>Or introduce a helpful typedef in Circular_arc_2:
>    typedef typename VVc_diagram_2<Traits_,
> AppKernel_>::Vertex_feature_2::Type Type;
>    virtual Type type () const
>    {
>      return Vertex_feature_2::CIRCULAR;
>    }

Hi Eljay...

Thank you very much. both of them works. 




John (Eljay) Love-Jensen wrote:
> 
> Hi mahmoodn,
> 
> In your code snippet, this Circular_arc_2 routine is malformed C++.
> 
>     virtual typename Vertex_feature_2::Type type () const
>     {
>       return (CIRCULAR);
>     }
> 
> Change it to this:
> 
>     virtual typename VVc_diagram_2<Traits_,
> AppKernel_>::Vertex_feature_2::Type type () const
>     {
>       return Vertex_feature_2::CIRCULAR;
>     }
> 
> Or introduce a helpful typedef in Circular_arc_2:
> 
>     typedef typename VVc_diagram_2<Traits_,
> AppKernel_>::Vertex_feature_2::Type Type;
> 
>     virtual Type type () const
>     {
>       return Vertex_feature_2::CIRCULAR;
>     }
> 
> HTH,
> --Eljay
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help-with-these-two-errors-tp14787660p14878819.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-01-16 12:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-14 13:09 Please help with these two errors mahmoodn
2008-01-14 15:45 ` John (Eljay) Love-Jensen
2008-01-15  8:30   ` mahmoodn
2008-01-15 15:17     ` John (Eljay) Love-Jensen
2008-01-16 12:05       ` mahmoodn
2008-01-16  0:45     ` Jonathan Saxton
2008-01-16 12:31       ` mahmoodn
2008-01-16 13:18         ` John (Eljay) Love-Jensen
2008-01-16 14:27           ` mahmoodn
2008-01-16 14:27             ` John (Eljay) Love-Jensen
2008-01-16 14:42             ` John (Eljay) Love-Jensen
2008-01-17  0:56               ` mahmoodn
2008-01-16 15:34             ` mahmoodn
2008-01-16 15:55             ` mahmoodn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).