Topic: Thread: Incoherency between the name of template parameters and the requirements


Author: Anthony Williams <anthony.ajw@gmail.com>
Date: Thu, 16 Sep 2010 11:38:17 CST
Raw View
viboes <vicente.botet@wanadoo.fr> writes:

> First paragraph in In 30.2.1 states
>
> "1 Throughout this Clause, the names of template parameters are used
> to express type requirements."
>
> This paragraph must be suppressed, changed to something less
> restrictive or the name of the template parameters must be changed. If
> If n3130 is accepted, the change should be as follows:
>
> * Mutex should be BasicLockable in 30.4.3.1
> * Mutex should be Lockable in 30.4.3.2
> * L1 should be Lockable1 in 30.4.4, ...
> * Lock should be BasicLockable in 30.5.4

Good idea.

> BTW, I don't find the the requirements for the template parameter R in
> promise and futures 3.6.5-8. Assignable or Movable?

For promise, a value must be MoveConstructible. For shared_future it
probably ought to be CopyConstructible, but MoveConstructible will
"work" --- you just will only be able to access the T contained
within the future's associated state by the const T& returned by get().

Anthony
--
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++0x thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: viboes <vicente.botet@wanadoo.fr>
Date: Wed, 15 Sep 2010 12:04:13 CST
Raw View
First paragraph in In 30.2.1 states

"1 Throughout this Clause, the names of template parameters are used
to express type requirements."

This paragraph must be suppressed, changed to something less
restrictive or the name of the template parameters must be changed. If
If n3130 is accepted, the change should be as follows:

* Mutex should be BasicLockable in 30.4.3.1
* Mutex should be Lockable in 30.4.3.2
* L1 should be Lockable1 in 30.4.4, ...
* Lock should be BasicLockable in 30.5.4

I will opt for making the changes and change the paragraph to
"1 Throughout this Clause, the names of template parameters are used
most of the times to express type requirements."

BTW, I don't find the the requirements for the template parameter R in
promise and futures 3.6.5-8. Assignable or Movable?

-
Vicente

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]