Saturday, January 2, 2016

Digest for comp.lang.c++@googlegroups.com - 5 updates in 1 topic

JiiPee <no@notvalid.com>: Jan 02 07:23PM

On 31/12/2015 21:23, Jorgen Grahn wrote:
>> yes this is what Bjarne seems to recommend as well
> Where does he recommend that, so I can look it up?
 
> /Jorgen
 
its possibly in the book "Programming Language 4th edition" which I have
been reading.... maybe to google. But not 100% sure.
JiiPee <no@notvalid.com>: Jan 02 07:30PM

On 31/12/2015 21:23, Jorgen Grahn wrote:
>> yes this is what Bjarne seems to recommend as well
> Where does he recommend that, so I can look it up?
 
> /Jorgen
 
he says in this video "Use int until you have a reason not to" at 12:50
 
https://channel9.msdn.com/Events/GoingNative/2013/Interactive-Panel-Ask-Us-Anything
 
Also the other one says there the same.
 
But I think it was also in his book.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 02 09:49PM

On Sat, 2016-01-02, JiiPee wrote:
 
>> /Jorgen
 
> he says in this video "Use int until you have a reason not to" at 12:50
 
> https://channel9.msdn.com/Events/GoingNative/2013/Interactive-Panel-Ask-Us-Anything
 
Thanks. You're right, he does say that, quite clearly. And also the
thing about bit-level above, plus "never mix signed and unsigned".
 
> Also the other one says there the same.
 
> But I think it was also in his book.
 
Which makes me wonder what they do to size_t, std::vector<T>::size_type
and so on ...
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Bo Persson <bop@gmb.dk>: Jan 02 10:56PM +0100

On 2016-01-02 22:49, Jorgen Grahn wrote:
 
>> But I think it was also in his book.
 
> Which makes me wonder what they do to size_t, std::vector<T>::size_type
> and so on ...
 
I have heard that some of those guys now also regret making size_type an
unsigned type.
 
Having both size_type and difference_type in the containers makes it
very hard to follow the advice "never mix signed and unsigned".
 
 
 
Bo Persson
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 02 10:34PM

On Sat, 2016-01-02, Bo Persson wrote:
> unsigned type.
 
> Having both size_type and difference_type in the containers makes it
> very hard to follow the advice "never mix signed and unsigned".
 
Which still leaves me confused because the standard library (of C++
and C) cannot be changed, and Stroustrup strikes me as the kind of
guy who gives advice for the /real/ world ...
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: