Tuesday, November 7, 2017

Digest for comp.lang.c++@googlegroups.com - 7 updates in 4 topics

Cholo Lennon <chololennon@hotmail.com>: Nov 07 04:30PM -0300

Hi all,
 
Silly question: Why 'return' must always be used in lambda's bodies? It
would be nice that it can be be omitted like in Java (if you have only
one sentence, braces and trailing semicolon can also be omitted).
 
For the sake of comparing both languages, forget the lambda type:
 
C++: foo = [](auto x) { return x + 1; };
Java: foo = x -> x + 1;
 
 
--
Cholo Lennon
Bs.As.
ARG
"Öö Tiib" <ootiib@hot.ee>: Nov 07 12:57PM -0800

On Tuesday, 7 November 2017 21:31:18 UTC+2, Cholo Lennon wrote:
 
> For the sake of comparing both languages, forget the lambda type:
 
> C++: foo = [](auto x) { return x + 1; };
> Java: foo = x -> x + 1;
 
It is just a question of syntax sugar. C++ designers have
typically extended the verbosity of C. BTW, Java has also taken
most of the verbose features of C (like C++):

* Why it was made that statements must be separated with semicolon
even when those are not on same line?
* Why there are mandatory parentheses around arguments of if, for,
while and switch?
* Why one needs to write "break" for each case of switch instead
of having keyword for (ultra rarely needed) fall-through?
* and so on ... same for C++ and Java
 
What I think (YMMV) that it does not really matter much.
We can gnaw out few characters here or there but what is
the gain? It is so in C and it works so why to change it?
The result may be even confuses someone. Some people even add
redundant characters voluntarily. They put parentheses around
return value or argument of sizeof or argument of throw.
They add redundant "this->" to member accesses in member
functions. They feel that more characters there helps them to
read the code.
 
The actual problems to solve are always likely elsewhere.
Intelli2 <intelli2@mama.com>: Nov 07 08:02PM -0500

Hello,
 
 
My Scalable FIFO queues for C++ are here..
 
Author: Amine Moulay Ramdane
 
Description:
 
Those are two scalable FIFO queues, one is bounded and the other
unbounded, they use a distributed technic over many FIFO queues and they
use scalable counting networks so that to be scalable, you can test them
on NUMA systems to notice that they are truly scalable.
 
And counting networks are truly scalable and are a special type of
balancer networks which count.
 
 
Here is the parameters of the constructor:
 
First parameter is: You have to pass the number of queues to the
constructor so that to scale.
 
Second parameter is: The queue size of each queue, that must be a power
of 2, it is now at 14, that means 2^14=16384.
 
Third parameter is: The scalable counting networks width, that must be a
power of 2, it is now at 10 , that means 2^10=1024.
 
Fourth parameter is: The size of the scalable array based lock, it's now
at 1024.
 
Language: GNU C++ and Visual C++ and C++Builder
 
- Platform: Windows and Linux(x86)
 
 
You can download my scalable FIFO queues for C++ from:
 
https://sites.google.com/site/aminer68/scalable-fifo-queues-for-c
 
 
Thank you,
Amine Moulay Ramdane.
Juha Nieminen <nospam@thanks.invalid>: Nov 07 12:31PM

> On Tuesday, October 31, 2017 at 1:56:32 AM UTC-4, Juha Nieminen wrote:
>> Your hypocrisy knows no bounds.
 
> It's why I need a savior.
 
Then stop being a hypocrite. It's easy.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Nov 07 05:01AM -0800

I've asked you repeatedly, Juha ... how am I a hypocrite? I tell you
I too need a savior for my sin. I tell you Jesus is the only way.
 
I live what I teach as best I'm able. It is a real, purposeful choice.
 
So, for the last time, how am I a hypocrite? Please explain.
 
--
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 07 07:54PM

On 07/11/2017 12:31, Juha Nieminen wrote:
>>> Your hypocrisy knows no bounds.
 
>> It's why I need a savior.
 
> Then stop being a hypocrite. It's easy.
 
Holy? Rick's god is certainly full of holes as is his religion.
 
/Flibble
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 07 08:48AM +0100

On 11/6/2017 8:32 PM, Mr Flibble wrote:
>         return *result;
>     }
 
> No sausages I'm afraid.
 
I don't see anything obviously wrong, but then I don't see obviously how
it works. :)
 
Still, it appears the code fights the strict typing.
 
Might help with auxiliary definitions like
 
template< class Key, class Value >
using Fastmap = std::map<
Key, Value, std::greater<Key>,
boost::fast_pool_allocator<std::pair<Key, Value>>
>;
 
Oh well that might be it, that the key part of the pair should be
`const`, yes?
 
There's an amazing little gotcha in the standard, that even something
that's /dynamically allocated/ as originally `const` can't be modified
without UB. Not directly relevant here but amazing anyway. :)
 
 
Cheers!,
 
- Alf
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: