Boost logo

Boost :

From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2008-08-22 14:49:56

>> On 20/08/2008, Simonson, Lucanus J <lucanus.j.simonson_at_[hidden]>
>>>> I third the question, should we make separating template
>> declarations
>>>> from their definitions a preferred practice?
>> Daniel wrote:
>>>Some libraries don't do this because they still support older
>>>compilers where template functions have to be defined inline.
>> Is this rational still valid for new libraries? I would imagine that
>> there are a number of recent libraries accepted that don't support
>> older compilers for other reasons. I was proposing we make it a
>> preferred practice for ongoing and future development. I would not
>> suggest we revise mature libraries to conform to this style. Do you
>> think that is reasonable?
>Dave wrote:
>Frankly I find that style adds so much syntactic overhead that it
>benefits readability.

I agree with you that while implementing a template library keeping the
definitions in the declaration area is much more convenient and helpful
than separating them. It avoids cyclic dependency problems in
definitions, it reduces the number of files and it makes writing the
code all around easier. Defining a template function of a template
class separate from its declaration does require a lot of extra
syntactic overhead in the definition, but it certainly doesn't hurt the
readability of the declaration, and that is the readability I'm
concerned with.


Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at