Skip to content

CGAL: About namespace internal #8896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,31 @@ but the better alternative is the usage of `namespace`.

\section Developer_manualNamespaceCGAL Namespace CGAL

All names introduced by \cgal should be in namespace `CGAL`, <I>e.g.</I>:
All names introduced by \cgal should be in namespace `CGAL`, or in a subnamespace
corresponding to a package, <I>e.g.</I>:
\code{.cpp}
#include <something>

namespace CGAL {

class My_new_cgal_class {};
/*!
* This class ...
*/
class Foo {};


namespace Polygon_mesh_processing {

My_new_cgal_class
my_new_function( My_new_cgal_class& );
/*!
* modifies `f` by ...
*/
void
bar( foo & f);

} // namespace Polygon_mesh_processing
} // namespace CGAL
\endcode

Make sure not to have include statements inside the
`namespace CGAL`. Otherwise, all names defined in the file included will be
added to the namespace.
Expand All @@ -35,19 +47,15 @@ added to the namespace.
All names introduced by \cgal which are not documented to the user
should be under an `internal` subnamespace of `CGAL`, <I>e.g.</I>:
\code{.cpp}
namespace CGAL { namespace internal {

class My_undocumented_class {};

void my_new_function( My_undocumented_class& );

}} // namespace CGAL::internal

namespace CGAL { namespace internal { namespace Package { namespace tags {
namespace CGAL {
namespace Polygon_mesh_processing {
namespace internal {

class Some_further_class_local_to_Package;
class Baz_used_by_foo {};

}}}} // namespace CGAL::internal::Package::tags
} // namespace internal
} // namespace Polygon_mesh_processing
} // namespace CGAL
\endcode

\section Developer_manualNoteonglobaltemplatefunctions Note on global template functions
Expand Down