|
Boost : |
Subject: [boost] [polygon] GTL name change and pre-review issues
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-06-19 13:28:10
I am changing the name of my library from GTL (Geometry Template Library) to boost::polygon and narrowing the scope from "computational geometry" to "polygon manipulation". This scope precisely describes the current scope of what is implemented. It also clarifies the position of the library relative to similar proposals.
I have already moved the code into boost::polygon namespace, added dependency on boost::enable_if and gotten the unit tests compiling and passing in windows with the new namespace and dependency.
I wanted to ask about the gtl_yes and gtl_no types I use for metaprogramming, defined thus:
struct gtl_no { static const bool value = false; };
struct gtl_yes { typedef gtl_yes type;
static const bool value = true; };
I need to define type as gtl_yes in gtl_yes and leave it undefined in gtl_no to enable early SFINAE to work around an EDG compiler bug:
template <typename geometry_type_1, typename coordinate_type_1>
typename enable_if< typename gtl_and<
typename is_mutable_polygon_90_set_type<geometry_type_1>
#ifdef __ICC
::type
#endif
::type,
typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>
#ifdef __ICC
::type
#endif
::type,
geometry_type_1>::type
operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
geometry_type_1 retval(lvalue);
retval -= rvalue;
return retval;
}
Here I am short circuiting template instantiation in the case that ICC (using EDG) is detected by calling the gtl_yes/gtl_no metafunction. This would be a syntax error in MSVC, of course. I need to do this for arithemetic operators because EDG incorrectly tries to match them to operators between pointer and unnamed enum type values in the stl and throws a syntax error when I refer to the unnamed enum type in the declaration of the operator. By SFINAEing out early I can work around this bug, which is fixed in the latest EDG versions, but I need to support older versions as well.
Is it acceptable to continue to use my own definitions for true_type/false_type, or does someone have a suggestion for a different workaround that will allow me to replace gtl_yes/gtl_no with boost::true_type, boost::false_type?
By the way, complete documentation for my library is now available at https://svn.boost.org/svn/boost/sandbox/gtl/doc/index.htm
Feedback on the documentation before the formal review will help me get ready for the review.
I'll be checking review ready code into the sandbox later today along with unit tests. If someone can point me to setup my unit test source file to work with the boost unit testing system I'd greatly appreciate it. Right now it just uses returning an error code to indicate test failure, and it is all or nothing in that sense.
Regards,
Luke
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk