Boost logo

Geometry :

Subject: [ggl] Reviewing GGL against Boost requirements
From: Mateusz Loskot (mateusz)
Date: 2009-04-20 07:15:40

Barend Gehrels wrote:
>>> One thing about 80 characters: this guideline in much more easy to
>>> follow when namespaces are not indented. It's the case in a lot of
>>> Boost code and it's quite accepted in the C++ community. So given the
>>> number of nested namespaces we sometimes have in GGL we could do that
>>> as well. I've never noticed any particular problem of readability in
>>> code I've written that way.
>> So, we're going to not to indent code on namespace level, right?
> OK.


>> namespace a {
>> class T
>> {
>> public:
>> void foo();
>> protected:
>> void bar();
>> private:
>> std::size_t count_;
>> };
>> } // namespace a
> Few things about this:
> - I prefer a struct above a class because, especially in templates, many
> is public, often there is no protected / private at all
> - T in lowercase
> - I've always used the m_ prefix for member variables, don't know where
> it comes from. Find them much more readable. The boost sample header
> gives no prefix/suffix at all. However, the m_ prefix is used in some
> (not many) boost libraries as well (e.g. math/tools/remez). So here I
> prefer to keep them, at least in this refactoring round
> - In case of a template, I prefer the "typename" above the "class"
> (unless, of course, if it is required as in template template parameters)
> [...]

Sure, agreed.

The snippet I pasted was supposed to show indentation only,
not all-in-one coding style.

Best regards,

Mateusz Loskot,

Geometry list run by mateusz at