Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Access to CGAL source files

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Access to CGAL source files


Chronological Thread 
  • From: Louis Lavery <>
  • To:
  • Subject: Re: [cgal-discuss] Access to CGAL source files
  • Date: Tue, 30 Mar 2010 10:30:43 +0100

Laurent Rineau (GeometryFactory) wrote:
On Tuesday 30 March 2010 10:01:39 Louis Lavery wrote:
Guilherme Kunigami wrote:
Thank you very much Avishek, I found them!
I've forgotten that templated classes definitions can' t be put in a .cpp
file.
That's not true. They can, and, IMO, it's a good idea to do so as it
reduces clutter.

Please let us know what you have in mind. In the use-case of CGAL, I can hardly imagine what templates we can put in the CGAL compiled libraries.

Neither can I, but that's not what I'm suggesting.

All I mean is that you can do that same as you do for non-template code.
You put the declaration in a header (so as users can see that) and the
definition in a .cpp (as the users don't really want/need to see that).

Of course, you need to #include the .cpp in the header (I think it's
natural to do that at the foot of the header) and put a #include guard
in the .cpp (to avoid recursion).

I find it a lot easier to work this way, both as an author and as a
user of a library.

I know some others also use this style (sorry, haven't a ref to hand)
and it works just fine. As I say, it reduces clutter in the header,
and that's important to me for my users.

Louis.




Archive powered by MHonArc 2.6.16.

Top of Page