Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-11-07 15:21:24


In message <D3E6C22AF7F13B4FB2490F89879B408F066099_at_SEA-DOG>, Gary Powell
<Gary.Powell_at_[hidden]> writes
>The issue with memory management is that in games we often have a fixed
>limited pool from which to allocate memory.
[...]

I'm familiar with these issues, but my real question is to what degree
do we want to parameterise every class we ever write and to what degree
do we want to consider some of these as more specialised cases?

>As for users having to know that any is a template, So?? All of STL is
>templates, the string class is templated, the i/o library is templated, you
>can't get away from it. Would perhaps an additional typedef, where the more
>complex name is the template solve your common usage problem?

That is not the issue, the issue is that writing T<> has no precedent
(IIRC) in the standard library. Every class template in the library must
be provided with at least one parameter. The zero parameter case just
makes any look odd, drawing unnecessary attention to a rarely used
syntax feature and what would be a rarely used parameterisation.

>template < class Allocator = default_allocator>
>class any_with_user_controled_memory_mangement;
>
>typedef any_with_user_controled_memory_management<> any;

What you make a good case for is a future, backwardly compatible
migration path.

This raises an interesting question if any were to move from class to
typedef: For library users, should the same requirements that exist on
forward declaring entities in the standard (ie that you can't) also be
applied to Boost?

Kevlin
____________________________________________________________

  Kevlin Henney phone: +44 117 942 2990
  Curbralan Limited mobile: +44 7801 073 508
  mailto:kevlin_at_[hidden] fax: +44 870 052 2289
  http://www.curbralan.com
____________________________________________________________


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk