Wednesday, January 17, 2018

Digest for comp.lang.c++@googlegroups.com - 25 updates in 8 topics

Real Troll <real.troll@trolls.com>: Jan 16 09:55PM -0400

I wonder whether there is any need to define data types these days when
we can easily declare automatic types using auto? For example this
program compiles just fine in modern compilers:
 
/************************************ auto.cpp
************************************/
#include <iostream>
#include <typeinfo>
#include <stdlib.h>
 
int main()
{
std::cout << "\t [auto.cpp]" << std::endl;
// Creating several auto-type variables
auto a = 1;
auto b = 1.0;
auto c = a + b;
auto d = {b, c};
// Displaying the preceding variables' type
std::cout << "\t type of a: " << typeid(a).name() << std::endl;
std::cout << "\t type of b: " << typeid(b).name() << std::endl;
std::cout << "\t type of c: " << typeid(c).name() << std::endl;
std::cout << "\t type of d: " << typeid(d).name() << std::endl;
return EXIT_SUCCESS;
}
 
/************************************ End
************************************/
Lynn McGuire <lynnmcguire5@gmail.com>: Jan 16 08:21PM -0600

On 1/16/2018 7:55 PM, Real Troll wrote:
> }
 
> /************************************ End
> ************************************/
 
Auto will not work for function arguments.
 
std::vector <std::string> PFXGroup::controllableSpecs (int index, int key)
 
Lynn
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 17 12:50PM

On Wed, 2018-01-17, Real Troll wrote:
> I wonder whether there is any need to define data types
 
You mean "spell out the type" or something.
 
> these days when
> we can easily declare automatic types using auto? For example this
> program compiles just fine in modern compilers:
...
> auto b = 1.0;
> auto c = a + b;
> auto d = {b, c};
...
 
Don't forget 'const auto' and 'const auto&'.
 
I don't think there's any concensus about when and how often to use
'auto'. Some say "as much as possible!" which I disagree with.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jan 17 02:21PM +0100

On 1/17/2018 1:50 PM, Jorgen Grahn wrote:
>> auto b = 1.0;
>> auto c = a + b;
>> auto d = {b, c};
 
What's that last?
 
 
 
> Don't forget 'const auto' and 'const auto&'.
 
> I don't think there's any concensus about when and how often to use
> 'auto'. Some say "as much as possible!" which I disagree with.
 
Me too, although the original Almost Always Auto author was Herb Sutter,
with review by Scott Meyers and Andrei Alexandrescu.
 
 
Cheers!,
 
- Alf
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jan 17 02:22PM +0100

On 1/17/2018 2:21 PM, Alf P. Steinbach wrote:
>>>       auto c = a + b;
>>>       auto d = {b, c};
 
> What's that last?
 
Oh, OK, it's a `std::initizer_list`. Moral: don't post when you feel the
urge to go the bathroom.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Jan 17 09:10PM

On Tue, 16 Jan 2018 20:21:01 -0600
> Auto will not work for function arguments.
 
Unless its a lambda expression.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 17 08:59PM

If parents never mention God or religion to their child the child will
naturally develop as an atheist and will have an instilled moral compass
based on their loving upbringing and nothing else.
 
A corollary?
 
An upbringing based on religious faith instilling a moral compass based
on the fear of eternal punishment; or to put it in more simple terms:
brainwashing; or to say what it really is: child abuse.
 
--
 
Thank you,
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 17 01:09PM -0800

On Wednesday, January 17, 2018 at 3:59:36 PM UTC-5, <strike>Rick C.
Hodgin</strike>Leigh Johnston wrote:
> If parents never mention God or religion to their child...
 
You have no idea the torment you are heaping upon your own head.
 
May God have mercy on your soul, Leigh.
 
--
Rick C. Hodgin
Thiago Adams <thiago.adams@gmail.com>: Jan 17 04:45AM -0800

On Monday, January 8, 2018 at 11:45:05 PM UTC-2, Mr Flibble wrote:
> > Do you use native controls? Native menu?
 
> At the moment OpenGL; in the future DirectX (via OpenGL ES) and Vulkan
> too. I do not use native controls.
 
 
Mr Flibble and others could you watch this:
 
It's about webassembly, and alternatives for UI running
in webbrowsers.
 
https://www.youtube.com/watch?v=MiLAE6HMr10&feature=youtu.be&t=27m28s
 
and tell me what do you think.
 
Please also see
 
https://pbrfrat.com/post/imgui_in_browser.html
and
https://github.com/ocornut/imgui
 
Should a new UI framework be separated from Web and
run only in desktop?
What do you think?
 
I think that the new UI must run in browsers.
It also can be very good to have 100% native apps without
browsers, but I think both will be possible and they
can share C/C++ code.
 
 
Flibble, maybe you can adapt your gui to run in a browser
using webassembly and webgl.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jan 17 08:50PM

On 17/01/2018 12:45, Thiago Adams wrote:
> can share C/C++ code.
 
> Flibble, maybe you can adapt your gui to run in a browser
> using webassembly and webgl.
 
I will look into it as a possible back-end option when I get chance.
 
/Flibble
 
 
 
--
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates
a world that is so full of injustice and pain. That's what I would say."
legalize+jeeves@mail.xmission.com (Richard): Jan 17 12:03AM

[Please do not mail me a copy of your followup]
 
Lynn McGuire <lynnmcguire5@gmail.com> spake the secret code
 
>Are the Android systems running X-Windows ?
 
(Nit: Technically the name is the "X Window System"
<https://en.wikipedia.org/wiki/X_Window_System>)
 
Android is a linux kernel with a GUI layer that was originally only
accessible from Java. (Disclaimer: I have a rudimentary understanding
of Android development and haven't done anything with real code.)
This blog post from 2012 shows some layers in their architecture:
<https://www.imgtec.com/blog/learning-about-the-android-graphics-subsystem/>
It is unclear which of these layers are accessible from C++; although
I imagine that all of the are accessible from Java as native
programming came later to Android.
 
This page seems more current and describes two APIs: Canvas and OpenGL
ES. <https://source.android.com/devices/graphics/> However, that
just covers output, it doesn't cover input or things like common GUI
controls.
<https://source.android.com/devices/input/>
 
If you look at their UI overview, it's all talking in terms of Java
<https://developer.android.com/guide/topics/ui/overview.html>
 
The Native Development Kit (NDK) is what you can write in C++:
<https://developer.android.com/ndk/guides/index.html>
 
Looking here, it looks you still have to do some portion of the UI in
Java if your application wants to use the standard widgets. If your
app is full-screen (e.g. a game) and does everything in OpenGL, then
you can forego the Java portion.
<https://developer.android.com/ndk/guides/stable_apis.html>
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
Ian Collins <ian-news@hotmail.com>: Jan 17 02:56PM +1300

On 01/17/2018 10:23 AM, Lynn McGuire wrote:
 
>>> I would still like to see a standard windowing user interface library.
 
>> Wasn't this attempted on *nix a few decades ago?
 
> And X-Windows failed to make it outside of Unix (that I know of).
 
XQuartz on Mac.
 
https://www.xquartz.org/
 
--
Ian.
legalize+jeeves@mail.xmission.com (Richard): Jan 17 02:10AM

[Please do not mail me a copy of your followup]
 
Ian Collins <ian-news@hotmail.com> spake the secret code
 
>> And X-Windows failed to make it outside of Unix (that I know of).
 
>XQuartz on Mac.
 
>https://www.xquartz.org/
 
There were also X Window System servers for the PC and X Terminals.
Heck, there is an X Server application in the android store :)
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
Lynn McGuire <lynnmcguire5@gmail.com>: Jan 16 08:10PM -0600

On 1/16/2018 6:03 PM, Richard wrote:
> app is full-screen (e.g. a game) and does everything in OpenGL, then
> you can forego the Java portion.
> <https://developer.android.com/ndk/guides/stable_apis.html>
 
Gotcha. It has been almost 30 years since I wrote a modicum of X
Windows code. And some XView code when we got a Sun workstation. Both
were related to an AutoCAD add-on that we were developing.
 
Lynn
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jan 17 03:36AM +0100

On 1/16/2018 10:32 PM, Daniel wrote:
> desktop interfaces aren't that interesting anymore.
 
> My wishes are more modest: a standard date and a standard decimal class.
> At least for these there is prior work.
 
Second that.
 
 
Cheers!,
 
- Alf
"Fred.Zwarts" <F.Zwarts@KVI.nl>: Jan 17 09:14AM +0100

"Ian Collins" schreef in bericht news:fc7or9FtrciU2@mid.individual.net...
 
>On 01/17/2018 10:23 AM, Lynn McGuire wrote:
>> On 1/16/2018 7:30 AM, cdalten@gmail.com wrote:
 
...
 
 
>> And X-Windows failed to make it outside of Unix (that I know of).
 
>XQuartz on Mac.
 
>https://www.xquartz.org/
 
OpenVMS, once a popular OS, started with its own windowing system, but later
moved to X-Windows.
scott@slp53.sl.home (Scott Lurndal): Jan 17 02:21PM


>>https://www.xquartz.org/
 
>There were also X Window System servers for the PC and X Terminals.
>Heck, there is an X Server application in the android store :)
 
There's an x-server and full set of x clients in cygwin, as well.
woodbrian77@gmail.com: Jan 17 10:59AM -0800

On Tuesday, January 16, 2018 at 5:22:01 AM UTC-6, Thiago Adams wrote:
> > finally get C++ 2011 right.
 
> What is the motivation to use the latest version
> of C++ in the generated code?
 
3 or the 4 things I mentioned aren't part of the
generated code. I use them in code that supports
the generated code:
https://github.com/Ebenezer-group/onwards
 
The one that can be part of the generated code is
string_view. String_view is an important addition to
the language in my opinion. From a technical perspective
we could have had it in 2007 rather than 2017.
 
 
> user will not change the generated code. If he does,
> then he lost the changes he did. It is one way generation,
> is that right?
 
I'm not sure I understand you, but changes made by a person
to a generated file (For example: https://github.com/Ebenezer-group/onwards/blob/master/tiers/zz.middleBack.hh)
 
are lost the next time the file is regenerated.
 
> have some customization points using templates or
> other C++ feature.
> C is a very good target for generators.
 
C is more stable than C++, but that's one of the
few things I think it has going for it compared to
C++.
 
 
Brian
Ebenezer Enterprises - Enjoying programming again.
http://webEbenezer.net
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 17 09:35AM -0800

I think of this woman and all she went through, and how easy so many
Christians like me have it in the U.S. We don't have to struggle for
our faith. Oh, we may be shunned by an online community, or we may
receive hate messages and posts designed to hurt us may be made very
often ... but it's nothing like what she went through.
 
Outreach is about changing the world by leading people to the hope
that God gave us through His only begotten Son, Jesus Christ. It's
about learning that we don't have to be the way the rest of the world
is because Jesus makes it possible for us to be really changed from
within.
 
From abuse to faith, from confinement to outreach:
 
http://www.foxnews.com/world/2018/01/17/christian-convert-from-iran-converting-muslims-in-sweden.html
 
--
Rick C. Hodgin
Ian Collins <ian-news@hotmail.com>: Jan 17 02:52PM +1300

On 01/17/2018 12:58 PM, Stefan Ram wrote:
> that do not change after construction "
 
> C++ Core Guideline; April 7, 2016;
> Bjarne Stroustrup and Herb Sutter
 
Function parameter types aren't defined objects.
 
--
Ian.
legalize+jeeves@mail.xmission.com (Richard): Jan 17 02:11AM

[Please do not mail me a copy of your followup]
 
Ian Collins <ian-news@hotmail.com> spake the secret code
 
>> C++ Core Guideline; April 7, 2016;
>> Bjarne Stroustrup and Herb Sutter
 
>Function parameter types aren't defined objects.
 
I think there's also a guideline that says not to modify function
parameters.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
James Kuyper <jameskuyper@verizon.net>: Jan 16 10:36PM -0500

On 01/16/2018 08:52 PM, Ian Collins wrote:
 
>> C++ Core Guideline; April 7, 2016;
>> Bjarne Stroustrup and Herb Sutter
 
> Function parameter types aren't defined objects.
 
Well, strictly speaking that's correct, types in general are not
objects. I presume you meant that function parameters are not defined
objects? By what argument?
asetofsymbols@gmail.com: Jan 17 05:38AM -0800

One can pass obj to a function using pointers or References
"Öö Tiib" <ootiib@hot.ee>: Jan 16 08:55PM -0800

On Monday, 15 January 2018 23:58:10 UTC+2, Vir Campestris wrote:
> > expectation that average programmers will have to look up a reference
> > manual to interpret it correctly.
 
> Thank you. I am not alone.
 
You are not alone. Tools also support view that precedence is not obvious.
For example clang assumes that in average we have forgot the precedence
of && and || and so it suggests (with -Wall) parentheses around &&.
 
Note that the parentheses and whitespaces are just cosmetics. The real
question is what to do if we reached EOF and ferror(in) returns not
zero. ;)
Alexander Huszagh <ahuszagh@gmail.com>: Jan 16 04:27PM -0800

On Thursday, January 11, 2018 at 8:48:25 PM UTC-8, Real Troll wrote:
 
> One of the contributors was a speaker at CPPCon2017 in this video:
 
> <https://www.youtube.com/watch?v=YxmdCxX9dMk&feature=youtu.be>
 
> He is Robert Ramey
 
I like almost all of the implementation code in Boost. I generally dislike a lot of the design choices made by the authors. I generally understand **why** this was made (to support ancient, buggy compilers), and sometimes fail to understand why (like why Boost filesystem silently converts UTF-16 paths to ANSI paths when narrow streams are required, even though it's easy to wrap HANDLEs into C++ streams, leading to disastrous consequences). Regardless, my impression of Boost as a whole is that it is an impressive, reusable, and extendable collection of code by some of the brightest C++ software developers out there that should be carefully curated before being using in production code.
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: