Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-02-24 00:41:45


David Abrahams <dave_at_[hidden]> writes:

| Alexander Terekhov <terekhov_at_[hidden]> writes:
|
| >> > David Abrahams <dave_at_[hidden]> writes:
| >> >
| >> > | I disagree with your conclusion. As I've said elsewhere, &k can be a
| >> > | compile-time constant in the same way that &X::k is a compile-time
| >> > | constant.
| >> >
| >> > Certainly, you've said that. But that assertion by itself does not
| >> > constitute a proof of the well-foundness of the attempted analogy or
| >> > whether the analogy actually constitutes a proof.
| >>
| >> It's not intended to be proof in the mathematical sense; I doubt I
| >> have the energy for that ;-), though I think MSVC probably constitutes
| >> an existence proof.
| >
| > Yeah. Indeed: <http://tinyurl.com/673e>
|
| OK, whatever. I guess I should've said that you can instantiate a
| template on &k with sensible results. Whether or not you want to call
| it a constant is another semantic matter. I'd call it a constant
| which evaluates differently in different threads.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And that isn't just a word-game as your message might imply it.

| Within a single thread the value never changes.

Like in

   template<typename T>
     struct X { };

   int main()
   {
      const int i = 2003;
      X<&i> x;
   }

?

In a given program run, &i won't change. That is just in single
thread mode. Let's solve that first.
Extrapolating to a multi-thread mode isn't just changing a word.

-- Gaby


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