Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2002-02-18 11:36:00


----- Original Message -----
From: "Carl Daniel" <cpdaniel_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, February 18, 2002 7:50 AM
Subject: Re: [boost] Most needed/desired features in C++

> I'd like to see the rule for template template argument
compatibility relaxed (e.g. such that std::vector<T,A=allocator>
> and myclass<T> would both be compatible with a template template
parameter declared as template <class>). The current
> rule appears to have been adopted to better meet with users
expectations (as compared to function pointer
> compatibility). The not-infrequent threads on c.l.c++.m about this
subject suggest that it did just the opposite:
> institutionalized behavior which is counter to expectations and
unnecessarily limiting.

While we're at it, why not allow the same thing for function pointers?

  void f(int = 5);
  void (*p)() = f;

This could be implemented by having the definition of 'f' create a
forwarding function:

  void __forwarding_f() { f(5); }

The original 'f' could be implicitly convertable to type 'void (*)()'
by substituting the address of '__forwarding_f'. ('__forwarding_f'
cannot be an overload of 'f' because of backwards compatability.)

--
Rainer Deyke | root_at_[hidden] | http://rainerdeyke.com

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