Tuesday, July 31, 2018

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

woodbrian77@gmail.com: Jul 30 06:19PM -0700

On Monday, July 30, 2018 at 5:05:38 PM UTC-5, jacobnavia wrote:
> my email anywhere and give people more opportunities to send me spam, so
> I tried to close that, but it is impossible. The programmer didn't put a
> close button or something to get out of that window.
 
Clicking on the "back" button works.
 
 
> This one has PHP code completion, a feature the author is very proud of.
> Animations in the screen show you typing and code completion at work.
 
> This "IDE" is then actually a PHP editor with code completion.
 
I agree that vim is good enough for most things, but they
may be on to something.
 
[ snip ]
 
 
> I took the link because you cited King. That was disconcerting enough to
> be worth a click.
 
> But using M. L. King to sell a PHP editor?
 
Not using him to sell anything. I appreciate his faith
and his work to create a colorblind society.
 
 
Brian
Ebenezer Enterprises
https://github.com/Ebenezer-group/onwards
David Brown <david.brown@hesbynett.no>: Jul 31 09:43AM +0200


> "On-line code generators aren't a viable solution -
> who wants to be dependent upon a third-party that
> may disappear tomorrow?"
 
That is just one of a dozen reasons why they are mostly irrelevant (and
mostly disliked by people who have to use them).
 
> https://codetasty.com/
 
> And there are a number of reasons why the C++ Middleware
> Writer (an on-line code generator) is better than codetasty:
 
How can you be comparing your obscure and limited "apple" to their
obscure and limited "orange", and concluding that yours is "better"? As
far as I understand it, you have made a code generator. They have made
an IDE. The only thing they have in common is that you use a browser to
work it.
 
 
> 1. The C++ Middleware Writer is free.
> 2. You don't have to upload all or even most of your project.
 
> Some of the "experts" here don't like the way things are going:
 
None of the experts (or "experts" either) here are bothered in the
slightest, because this is /not/ the way anything is going. Blind,
manic optimism and repeated assertions is not going to make "online code
generation" into anything significant outside very niche areas.
 
When ARM brought out its "mbed" system, it was originally using an
online IDE and compilers on their servers. People thought it was a
great idea for spending a few hours playing around and testing out the
system without installing massive editors, compiler suites, libraries,
etc. But it was also immediately clear that no one would use it for
anything serious until they could do everything entirely on their own
machines - something that ARM quickly supported.
 
 
> in a nation where they will not be judged by the color of
> their skin but by the content of their character."
> Pastor Martin Luther King Jr.
 
How has this /anything/ to do with /your/ dream that online code
generation will take over the world - or at least that /someone/ will
make use of your online code generator? Your delusions of grandeur
apparently know no bounds.
 
 
> While these "experts" could get a way with it they tried to
> sway people from my work. They were successful for a while,
> but that's starting to crumble now.
 
At the risk of upsetting your delicate sensibilities, that is complete
bollocks.
jacobnavia <jacob@jacob.remcomp.fr>: Jul 31 01:14PM +0200


> [ snip ]
 
Yes, you snipped this:
 
<I wrote >
 
No setup?
 
How can I tell it to display tabs at 6 positions? I would like to know.
And please, not 4, not 8, but 6. OK?
<end quote>
 
Can you tell me then, how do I do that in your editor???
 
No setup you say. OK
 
Just tell me how do I do it.
 
Thanks
"Öö Tiib" <ootiib@hot.ee>: Jul 31 11:29AM -0700

> > popular format) for compatibility.
 
> I'm open to adding support for JSON, but haven't worked on
> that yet.
 
It was just an example of real need that is behind what people choose.
Not the opinion of "experts" whom you accuse but actual necessity.
 
> > * Bigger data (like video and sound) are too expensive to serialize
> > without compression.
 
> There's support for compression via code from quicklz.com.
 
It had compression rates like 3:1 or 2:1 for plain text. Video
streams are massive so usually less than 50:1 is insufficient.
 
> > * Potentially confidential information needs to be serialized with
> > encryption.
 
> I don't have support for this yet, but agree it's important.
 
Again it is just an example that can be actual necessity. Even for
rather mundane reason like for to reduce ways for some online
game host to cheat and so to spoil it for his playmates.
 
> > libraries. What needs your code generator fulfills? If not any of
> > those three then there must be something else.
 
> It automates the creation of serialization functions.
 
That might be indeed convenience that some need but also it is quite
tricky to automate. Data is rarely free of complications so it usually
takes some indication by developer to make the tools or libraries to
realize how and what of it to serialize.
Look at your list http://webebenezer.net/supportedTypes.html
It does only mention std::unique_ptr and boost::scoped_ptr. What
does it do with raw pointers? Some may need deep restoration of raw
pointers. Some may need proper restoration of pointers to non-owned
data. What it does or does not do is unclear and are you really
expecting people to figure it out by trying?
 
> the code generator is easier than installing multiple
> versions of a library/compiler. Compiler Explorer is
> an example of this.
 
Are you avoiding my question about actual needs and benefits with such
random claims? People use things like Compiler Explorer to try out or
to demonstrate to others some special case about particular compiler
on toy examples. That has nothing to do with your product.
 
> in that area, but sometimes they don't. Because we have
> an on-line tool, we have an easier time deciding what to
> work on next.
 
Huh? What need that resolves? The compiler vendors are again doing
something else entirely in other league. Major ones have
money, patents, development teams and knowledge of likes of Microsoft,
Oracle, Apple, Google, Intel, and so on at their disposal. Even if
they are wrong at rate 10:1 then they will still add hundred things
that no one needs plus 10 things that lot of people need while you
ponder if to add support to JSON or what.
 
The question was: what are the needs that your product deals with
most outstandingly? Anyone who tries to market something must be is most
happy about that question. If you haven't thought that thru then you
should start from there I guess and not from accusing "experts" here
in your small user base.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 31 06:14PM +0100

Hi!
 
I'mma making an ECS!
 
That is all.
 
Message ends.
 
/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."
ram@zedat.fu-berlin.de (Stefan Ram): Jul 31 12:21PM

Some months ago I wrote:
 
>extend/improve/correct the parts given below?
>auto explain
>( bool DCu /* whether a default constructor is user-provided */,
 
. I asked about a C++ algorithm that exactly specifies when
certain constructors are defined implicitly.
 
It only now has come to my mind that some people inside and
outside the committee, especially Herb Sutter, are actually
working to make this happen! (It will not be in C++2a, but
it might come later.)
 
Turns out, they, too, do prefer algorithms to standardese,
and they call these algorithms (in this case) "metaclasses".
 
For more, watch the talk "Meta: Thoughts on generative C"
by Herb Sutter held at the cppcon 2017.
 
In the end, the source code of the default metaclass for
C++ classes should contain exactly the algorithm I asked for!
Thanks, Herb et al!
 
(I had to think of this, as I now watch the talk of Nicolai
Josuttis, who said that copy constructors are almost always
generated, unless one defines certain move operations. This
made me aware that I am still looking for a concise text
with a set of rules that tells me under which circumstances
certain constructors are not generated.)
ram@zedat.fu-berlin.de (Stefan Ram): Jul 31 04:39PM

>I am still looking for a concise text with a set of rules
>that tells me under which circumstances certain constructors
>are not generated.
 
Ok, found such a text in ...
 
*** SURPRISE! ***
 
Wikipedia (page about special member functions).
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 31 07:06AM +0200

On 30.07.2018 23:18, Stefan Ram wrote:
 
> So, is »decltype( a )::value_type« here the most elegant /
> natural / concise way to express that type or is there a
> better way?<
 
`auto` comes to mind.
 
As well as `decltype( +*a.begin() )`.
 
 
< (Since this is intended to show off »value_type«,
> »value_type« should appear in the answer. So, »auto v = ...«
> would not be helpful.)
 
An example where `value_type` is useful information could be some
interaction with some code that requires `value_type`. Yes I know that's
circular to some degree. But that's reality: much of this stuff is only
needed when using code that (needlessly?) depends on it.
 
Cheers!,
 
- Alf
Juha Nieminen <nospam@thanks.invalid>: Jul 31 06:08AM

> #include <iostream>
> #include <ostream>
 
Rather redundant, don't you think?
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 31 11:37AM +0200

On 31.07.2018 08:08, Juha Nieminen wrote:
>> #include <iostream>
>> #include <ostream>
 
> Rather redundant, don't you think?
 
With C++11 and later, yes.
 
With C++03 it was /formally/ required for the definition of << and for
std::endl, although ~all the examples in the standard that used text
output failed to include <ostream>.
 
Happily in ISO standards examples aren't normative, otherwise there
would have been a formal self-contradiction.
 
 
Cheers!,
 
- Alf
Manfred <noname@add.invalid>: Jul 31 12:30PM +0200

On 7/31/2018 7:06 AM, Alf P. Steinbach wrote:
> interaction with some code that requires `value_type`. Yes I know that's
> circular to some degree. But that's reality: much of this stuff is only
> needed when using code that (needlessly?) depends on it.
 
I'm not sure it is that needless - I would say it is not uncommon to
encounter value_type or similar type members when using template
libraries (the standard library being the first obvious example)
 
Another example is the boost library, recalling an older post where I
elaborated on a suggestion of yours:
 
> template< typename Range >
> bool is_even(const typename boost::range_value<Range>::type& x) { return x.index()%2 == 0; }
 
Here range_type, although with a different construct than value_type,
serves the same purpose: accessing a dependent type nested inside a
class template.
David Brown <david.brown@hesbynett.no>: Jul 31 08:04AM +0200

On 26/07/18 21:51, jacobnavia wrote:
 
> Gdb can also debug itself, but as a part of an IDE it is quite awfull
> really. The many commands that you have to remember... pages and pages
> of documentation...
 
I can't see your problem at all. I have used gdb with IDE's for a
couple of decades - no commands are needed. gdb has several interfaces,
including the command-line interface, the "MI" interface for front ends,
and (relatively recently) a python interface for automation, fancier
display of data, etc.
 
The command line interface to the debugger is great for certain tasks.
It lets you do common things quickly, and can be automated - I have used
it for scripting debugging or for programming and testing embedded
systems. But it is a bit tedious for general debugging use, unless you
use it enough to remember all the commands you need.
 
I have never used the MI interface directly - but I have used a number
of gdb front ends that use it. These days, that is usually Eclipse.
Debugging with gdb and Eclipse is not painless - but then, no debugging
is ever entirely painless, especially cross debugging, and there is
always a balance between efficient code and easily debugged code. A
huge advantage of the gdb system and its MI interface is that gdb and
the front end are separate - I can use one IDE with multiple gdb builds
for different target processors.
 
 
> It does some simple stuff, for instance if you start the name of an
> identifier it will fill it when you press tab, if there is one in the
> current scope that starts with those letters.
 
That is the command line interface - it is not something you use with an
IDE.
 
 
> A text mode application can't display much information though. Windows
> are much better for display info in a debugger.
 
Agreed (although the command line interface is occasionally handy).
That's why gdb has interfaces to graphical and windowed front ends.
 
> is 2+3; in other languages like C++
 
> Can elisp drive gdb?
 
> Gdb can be driven by the text commands interface. Apparently has no API.
 
Apparently it does - GDB/MI - and has had for a couple of decades or so.
It also has an extensive Python API, which is the modern way to handle
this. And it has a GNU Guile (Scheme) API. I haven't used these
myself, but then, I have not be involved in writing a debugger front end.
 
> You have to read the results of gdb by parsing text output...
 
The GDB/MI is a text interface (it is designed to work over a network
socket - I have had use of that, running the front end on a PC at home
and the gdb backend on a PC at the office). But it is designed to be
easy to parse.
 
Tim Rentsch <txr@alumni.caltech.edu>: Jul 31 01:19AM -0700


>>> Add into ~/.gnu-emacs-custom :
 
>>> '(tab-width 4)
 
>>> I have to admit I have little idea what these lines do,
 
You may be better off for that. :)
 
> somehow related behind the scenes and how, what is
> backward-delete-char-untabify-method and why it is here in my
> instructions, etc.
 
To find out you can ask emacs:
 
ESC x describe-function RET add-hook RET
 
add-hook is a compiled Lisp function in `subr.el'.
(add-hook HOOK FUNCTION &optional APPEND LOCAL)
 
Add to the value of HOOK the function FUNCTION.
FUNCTION is not added if already present.
FUNCTION is added (if necessary) at the beginning of the hook list
unless the optional argument APPEND is non-nil, in which case
FUNCTION is added at the end.
 
The optional fourth argument, LOCAL, if non-nil, says to modify
the hook's buffer-local value rather than its default value.
This makes the hook buffer-local if needed, and it makes t a member
of the buffer-local value. That acts as a flag to run the hook
functions in the default value as well as in the local value.
 
HOOK should be a symbol, and FUNCTION may be any valid function. If
HOOK is void, it is first set to nil. If HOOK's value is a single
function, it is changed to a list of functions.
 
ESC x describe-variable RET c++-mode-hook RET
 
c++-mode-hook is a variable defined in `cc-vars.el'.
Its value is nil
 
Documentation:
*Hook called by `c++-mode'.
 
You can customize this variable.
 
ESC x describe-variable RET backward-delete-char-untabify-method RET
 
backward-delete-char-untabify-method is a variable defined in `simple.el'.
Its value is untabify
 
Documentation:
*The method for untabifying when deleting backward.
Can be `untabify' -- turn a tab to many spaces, then delete one space;
`hungry' -- delete all whitespace, both tabs and spaces;
`all' -- delete all whitespace, including tabs, spaces and newlines;
nil -- just delete one character.
 
You can customize this variable.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 31 08:43AM

On Mon, 2018-07-30, Paavo Helde wrote:
> '(lambda () (setq tab-width 4) (setq c-basic-offset 4)))
> (setq backward-delete-char-untabify-method nil)
> (add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
 
Yeah, that's the recipe you tend to find first when googling, for
some reason. I find the "bsd4 is like bsd, but with offset 4" construct
much more convenient, plus the style gets a name and you can switch
to it with "C-c ."
 
If I wanted to indent by 4 with 4-wide TABs[0], I'd do something like:
 
(c-add-style "paavo" '("bsd" (c-basic-offset . 4) (tab-width . 4)
(indent-tabs-mode . t)))
(setq c-default-style "paavo")
 
 
> '(tab-width 4)
 
> I have to admit I have little idea what these lines do, and why
> modifying two files is necessary.
 
I don't understand ~/.gnu-emacs-custom either. Something that gets created
if you try to customize via point and click, I suspect. I never
trusted that feature to do anything sensible, but perhaps I'm wrong.
 
/Jorgen
 
[0] Seems to be a common convention on Windows; it would be nice if
Emacs had it as a predefined style and called it "visualstudio"
or something.
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 31 09:30AM

On Tue, 2018-07-10, Bo Persson wrote:
> explains, and the nature of programming means that significant amounts
> of time get dedicated to "what is essentially busywork."
 
> without him fully realizing that.
 
I didn't understand "busywork". Wikipedia says "... activity that is
undertaken to pass time and stay busy but in and of itself has no
actual value". Doesn't seem right to me -- did he mean to use some
other word?
 
Because one dangerous aspect of such work is, IME, that you tend to
forget that it has no value.
 
> I have seen the "new system"-syndrome in real life:
 
Perhaps it doesn't need saying, but I think we all have, if we've been
in the business for a while.
 
[snip very illustrative story]
 
There's a saying (and a Kylie Minogue song) "better the devil you
know", but we don't seem to follow it.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Tim Rentsch <txr@alumni.caltech.edu>: Jul 31 01:05AM -0700

> to the C99 standard and MSVC++ doesn't even support C99 properly
> anyway. The de facto C standard is still C89 and probably always
> will be.
 
That used to be true but isn't any longer. In particular, gcc
in its default mode used to be based on C89/C90, but now is
based on C11.
boltar@cylonHQ.com: Jul 31 08:24AM

On Tue, 31 Jul 2018 01:05:54 -0700
 
>That used to be true but isn't any longer. In particular, gcc
>in its default mode used to be based on C89/C90, but now is
>based on C11.
 
Fair enough. I didn't even realise there was a C 2011 and looking at it the
updates seem fairly specialised and nothing that isn't already in C++ anyway
so I don't think I'll be looking into it much further. Useful to know though.
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Jul 31 01:40AM -0700


>> That used to be true but isn't any longer. In particular, gcc
>> in its default mode used to be based on C89/C90, but now is
>> based on C11.
 
Tell me when GCC fully supports C11 threading and atomics. So far, only
Pelles C does it. Well, it "kind of" supports the atomics:
 
https://forum.pellesc.de/index.php?topic=7311.0
 
https://forum.pellesc.de/index.php?topic=7167.0
 
damn.
 
 
gazelle@shell.xmission.com (Kenny McCormack): Jul 31 07:20AM

In article <5d9825cb-8cbc-4975-bc1c-8570fc9071ea@googlegroups.com>,
>> This post showing much we want Rick C hodgin to leave this group.
>> If you want him to leave. Leave you name in reply. thanks
 
>+1.
 
I can no more imagine CLC/C++ without the amusement generated by Rick, than
I can imagine either group without the amusement of Kiki (*).
 
(*) Yes, as far as I know, Kiki only posts in CLC (not C++), but the point
is still valid. FWIW, there doesn't seem to be any standard appointed
topicality cop in CLC++ like there is in CLC. Which is a shame...
 
--
Pensacola - the thinking man's drink.
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.

Monday, July 30, 2018

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

ram@zedat.fu-berlin.de (Stefan Ram): Jul 30 10:46PM

>void PrintFirstOf(const Container& c)
>{
> typename Container::value_type v = std::get<0>(c);
 
Good idea, I will use this one, albeit a little later, in a
lesson dedicated to parameters of user-defined types. Thank
you!
 
>As a side effect it would be probably good to add here some
>assurance that the size oft he array is > 0
 
Yes. But the expression with »::std::get< 0 >« (from my
original program) already is quite close to this:
 
main.cpp
 
#include <array>
int main() { ::std::array< int, 0 >a; ::std::get< 0 >( a ); }
 
transcript
 
compiler error: static assertion failed: array index is within bounds
 
.
Sam <sam@email-scan.com>: Jul 30 05:58PM -0400

Stefan Ram writes:
 
> better way? (Since this is intended to show off »value_type«,
> »value_type« should appear in the answer. So, »auto v = ...«
> would not be helpful.)
 
I know of no other way to reference the type of the values in a container,
other than it's value_type.
 
As an aside when one's "drafting a lesson": it's true that it's useful to
point out why someone might want to explicitly specify "::std" in this
manner; as well as go over what "::std::this" or "::std::that" means, and
point out what this does, and why. But overusing the double-colons like that
makes C++ look like bad Perl.
 
I happen to like Perl. And I use Perl. And there's nothing wrong with Perl,
but there's everything wrong with bad Perl. And "::std::this" and
"::std::that" makes the whole thing, above, look like bad Perl or the C++
version of the obfuscated C context, and the most it would accomplish is
make everyone's eyes bleed.
 
So let's just stick to simply "std::this" or "std::that", to make the end
result look like elegant C++ (and using sensible identation would also be a
plus). This will still be free of the "using namespace std;" annoyance, but
without going to the other extreme of spraying "::" everywhere, merely to
show off one's pedantic understanding of C++, but also making the resulting
code more convoluted than it needs to be.
Manfred <invalid@add.invalid>: Jul 31 12:26AM +0200

On 07/30/2018 11:18 PM, Stefan Ram wrote:
> better way? (Since this is intended to show off »value_type«,
> »value_type« should appear in the answer. So, »auto v = ...«
> would not be helpful.)
 
things like value_type are most useful with template (meta)programming,
so it could be useful to show its use with template type arguments,
instead of decltype:
 
 
#include <array>
#include <initializer_list>
#include <iostream>
#include <ostream>
#include <string>
 
using namespace ::std::literals;
 
template<typename Container>
void PrintFirstOf(const Container& c)
{
typename Container::value_type v = std::get<0>(c);
 
std::cout << v << std::endl;
}
 
int main()
{
{
::std::array const a{ 4, 2, 7 };
PrintFirstOf(a);
// decltype( a )::value_type v = ::std::get< 0 >( a );
// ::std::cout << v << '\n';
}
 
{
::std::array const a{ "alpha"s, "gamma"s, "delta"s };
PrintFirstOf(a);
// decltype( a )::value_type v = ::std::get< 0 >( a );
// ::std::cout << v << '\n';
}
}
 
As a side effect it would be probably good to add here some assurance
that the size oft he array is > 0
jacobnavia <jacob@jacob.remcomp.fr>: Jul 31 12:05AM +0200

> Here's a link to a cloud-based IDE
> https://codetasty.com/
 
I followed that link, and I thought that I arrived to some tutorial or
similar. So I clicked into "Get started"
 
A window appears that asks for my email. In general I do not like to put
my email anywhere and give people more opportunities to send me spam, so
I tried to close that, but it is impossible. The programmer didn't put a
close button or something to get out of that window.
 
Of course I can close it with closing the tab in the navigator, what I
did. Then reloaded the page and started looking at something that could
tell me what this software does...
 
I scrolled down and read:
 
<quote>
Real-time language tools
that make you smarter
<end quote>
 
Yeah smarter, of course I need that tool, dumb as I am...
 
Then:
 
<quote>
Our IDE helps you write readable and clean code the smarter way - in
real time.
<end quote>
 
Sure, vi does that too. I write code in vi in real time, and after I
type something, I see immediately what I type. In real time. Gone are
the old days when I waited in some editor, for the characters that I
type to appear in the screen. All editors are real time now.
 
This one has PHP code completion, a feature the author is very proud of.
Animations in the screen show you typing and code completion at work.
 
This "IDE" is then actually a PHP editor with code completion.
 
There is no word of a debugger, advanced syntactic search possibilities
whatever. No trace of an IDE.
 
It can handle, as it says, files of hundred thousand lines or even more.
Great.
 
Vim does that too.
 
Or emacs, or visual studio or whatever.
 
<quote>
What makes us top-notch
<end quote>
 
Yeah, I wonder... WHAT?
 
<quote>
No Setup
<end quote>
 
No setup?
 
How can I tell it to display tabs at 6 positions? I would like to know.
And please, not 4, not 8, but 6. OK?
 
I took the link because you cited King. That was disconcerting enough to
be worth a click.
 
But using M. L. King to sell a PHP editor?
 
Wait a minute man. Have more respect for black people ok?
 
Do not USE them in your marketing stuff.
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.

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

woodbrian77@gmail.com: Jul 30 12:50PM -0700

If you have been reading this forum for any length
of time you will have read things like:
 
"On-line code generators aren't a viable solution -
who wants to be dependent upon a third-party that
may disappear tomorrow?"
 
Here's a link to a cloud-based IDE
https://codetasty.com/
 
And there are a number of reasons why the C++ Middleware
Writer (an on-line code generator) is better than codetasty:
 
1. The C++ Middleware Writer is free.
2. You don't have to upload all or even most of your project.
 
Some of the "experts" here don't like the way things are going:
"I have a dream that my four little children will one day live
in a nation where they will not be judged by the color of
their skin but by the content of their character."
Pastor Martin Luther King Jr.
 
While these "experts" could get a way with it they tried to
sway people from my work. They were successful for a while,
but that's starting to crumble now.
 
 
Brian
Ebenezer Enterprises
https://github.com/Ebenezer-group/onwards
scott@slp53.sl.home (Scott Lurndal): Jul 30 08:31PM

>may disappear tomorrow?"
 
>Here's a link to a cloud-based IDE
>https://codetasty.com/
 
8.1 - CodeTasty cannot be held liable for system down time,
crashes or data loss. We cannot be held liable for any
predicated estimate of profits which a client would have
gained if CodeTasty site was functioning. Certain services
provided by CodeTasty are resold. CodeTasty holds no responsibility
for the use of our clients' accounts. Failure to comply with any
terms or conditions will result in the automatic deactivation of
the account in question. We reserve the right to remove any account,
without advance notice for any reason without restitution, as CodeTasty sees fit.
 
'nuf said.
"Öö Tiib" <ootiib@hot.ee>: Jul 30 01:55PM -0700


> While these "experts" could get a way with it they tried to
> sway people from my work. They were successful for a while,
> but that's starting to crumble now.
 
Why you compare you product with some oddball IDE that no one cares
about?

What your code generator does that people need from serialization code?
For example:
* Lot of projects need to serialize data as XML or JSON (or some other
popular format) for compatibility.
* Bigger data (like video and sound) are too expensive to serialize
without compression.
* Potentially confidential information needs to be serialized with
encryption.
Such are some of the real needs that drive the choice of protocols and
libraries. What needs your code generator fulfills? If not any of
those three then there must be something else.
 
Why they need that code, free or otherwise, by uploading their code
anywhere or nowhere? These two are not benefits if they do not need
that code.
woodbrian77@gmail.com: Jul 30 02:12PM -0700

On Monday, July 30, 2018 at 3:31:58 PM UTC-5, Scott Lurndal wrote:
> crashes or data loss. We cannot be held liable for any
> predicated estimate of profits which a client would have
> gained if CodeTasty site was functioning.
 
That's to be expected, especially for free services. If
the service isn't reliable the company behind it will suffer
for it.
 
 
Brian
http://webEbenezer.net
woodbrian77@gmail.com: Jul 30 02:51PM -0700

On Monday, July 30, 2018 at 3:55:48 PM UTC-5, Öö Tiib wrote:
> For example:
> * Lot of projects need to serialize data as XML or JSON (or some other
> popular format) for compatibility.
 
I'm open to adding support for JSON, but haven't worked on
that yet.
 
> * Bigger data (like video and sound) are too expensive to serialize
> without compression.
 
There's support for compression via code from quicklz.com.
 
> * Potentially confidential information needs to be serialized with
> encryption.
 
I don't have support for this yet, but agree it's important.
 
> Such are some of the real needs that drive the choice of protocols and
> libraries. What needs your code generator fulfills? If not any of
> those three then there must be something else.
 
It automates the creation of serialization functions.
 
The cloud-ness of it means:
1. The amount of code that you have to download/build/
maintain is minimized. So using multiple versions of
the code generator is easier than installing multiple
versions of a library/compiler. Compiler Explorer is
an example of this.
 
2. We are able to get a better idea of what to work on
than compiler vendors. Compiler vendors have to decide
whether to support things in the standard or things their
users are asking for. Maybe they make good decisions
in that area, but sometimes they don't. Because we have
an on-line tool, we have an easier time deciding what to
work on next.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
ram@zedat.fu-berlin.de (Stefan Ram): Jul 30 09:18PM

I'm drafting my lesson about »::std::array«.
This is the example program for »value_type«:
 
main.cpp
 
#include <array>
#include <initializer_list>
#include <iostream>
#include <ostream>
#include <string>
 
using namespace ::std::literals;
 
int main()
{ { ::std::array const a{ 4, 2, 7 };
decltype( a )::value_type v = ::std::get< 0 >( a );
::std::cout << v << '\n'; }
 
{ ::std::array const a{ "alpha"s, "gamma"s, "delta"s };
decltype( a )::value_type v = ::std::get< 0 >( a );
::std::cout << v << '\n'; }}
 
transcript
 
4
alpha
 
So, is »decltype( a )::value_type« here the most elegant /
natural / concise way to express that type or is there a
better way? (Since this is intended to show off »value_type«,
»value_type« should appear in the answer. So, »auto v = ...«
would not be helpful.)
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 30 11:58AM

On Thu, 2018-07-26, Paavo Helde wrote:
> On 26.07.2018 15:00, Juha Nieminen wrote:
...
 
> Agreed. For my modest indentation preferences (TABs displayed as 4
> spaces) I need to edit 2 configuration files and add some cryptic lines
> (the simpler one has also a mouse-clickable option somewhere, to be honest).
 
If you meant to write "4-position indentation", this is how my .emacs
does it:
 
(c-add-style "bsd4" '("bsd" (c-basic-offset . 4)))
(setq c-default-style "bsd4")
 
Another Emacs drawback is that the latest release still (I think)
doesn't support C++11. You have to install a newer cc-mode to
e.g. indent lamdas reasonably. I use cc-mode 5.33.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
boltar@cylonHQ.com: Jul 30 01:39PM

On 30 Jul 2018 11:58:53 GMT
 
>Another Emacs drawback is that the latest release still (I think)
>doesn't support C++11. You have to install a newer cc-mode to
>e.g. indent lamdas reasonably. I use cc-mode 5.33.
 
I just use vim and the tab key. Never had to worry about the tab key not
supporting language versions or needing to be upgraded.
Paavo Helde <myfirstname@osa.pri.ee>: Jul 30 08:28PM +0300

On 30.07.2018 14:58, Jorgen Grahn wrote:
> does it:
 
> (c-add-style "bsd4" '("bsd" (c-basic-offset . 4)))
> (setq c-default-style "bsd4")
 
In my witch recipes it reads:
 
Add into ~/.emacs :
 
(add-hook 'c++-mode-hook
'(lambda () (setq tab-width 4) (setq c-basic-offset 4)))
(setq backward-delete-char-untabify-method nil)
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
 
Add into ~/.gnu-emacs-custom :
 
'(tab-width 4)
 
I have to admit I have little idea what these lines do, and why
modifying two files is necessary.
Melzzzzz <Melzzzzz@zzzzz.com>: Jul 30 05:33PM


> '(tab-width 4)
 
> I have to admit I have little idea what these lines do, and why
> modifying two files is necessary.
 
That's Lisp. setq sets value to variable(symbol). add-hook and all are
functions as is setq. (function param1 param2 ...)
 
--
press any key to continue or any other to quit...
Paavo Helde <myfirstname@osa.pri.ee>: Jul 30 08:56PM +0300

On 30.07.2018 20:33, Melzzzzz wrote:
>> modifying two files is necessary.
 
> That's Lisp. setq sets value to variable(symbol). add-hook and all are
> functions as is setq. (function param1 param2 ...)
 
Yes, that's the "little" I know. What I don't know is what the add-hook
exactly does, is the symbol c++-mode-hook somehow magic or defined
somewhere else, are the symbols c++mode-hook and c++-mode somehow
related behind the scenes and how, what is
backward-delete-char-untabify-method and why it is here in my
instructions, etc.
David Brown <david.brown@hesbynett.no>: Jul 30 08:56PM +0200

On 26/07/18 21:48, Ian Collins wrote:
>> quick
>> as indentation then perhaps development isn't the right job for them.
 
> It's not laziness, it's an editor changing what I write!
 
It is the editor doing the simple, automated stuff so that the
programmer can concentrate on more important things.
 
Automatic indentation can be a pain if an editor tries to be too smart
about it while failing to allow the customisation you want. But if it
is either fairly simple, or if it can be set to match your own style,
then it is a very handy benefit of the editor.
Melzzzzz <Melzzzzz@zzzzz.com>: Jul 30 08:45PM

> related behind the scenes and how, what is
> backward-delete-char-untabify-method and why it is here in my
> instructions, etc.
 
Well, if you don't have that documented you can only guess...
 
--
press any key to continue or any other to quit...
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 30 03:48AM +0200

On 29.07.2018 16:42, Mr Flibble wrote:
>> <windows.h>. The solution: to define `WIN32_LEAN_AND_MEAN`.
 
>> Also, I discovered, `_UNICODE` (not just `UNICODE`) needs to be
>> defined to make the wxWidgets environment detection scheme work.
 
After posting that I discovered that there's also a redefinition of M_PI
it isn't already defined. Which with MSVC then can trigger a warning
about "already defined". Which is not acceptable when one compiles with
warnings as errors.
 
So my current wrapping of the include of the wxWidgets main header now
looks like this:
 
 
------------------------------------------------------------------------
// The following two macros defined by <wrapped-windows/windows-h.hpp>:
// WIN32_LEAN_AND_MEAN avoids dragging in buggy part of <windows.h>
// _UNICODE makes wxWidgets macro scheme work.
#include <wx/msw/winver.h> // Windows version macros.
#include <wrapped-windows/windows-h.hpp> //
#include <stdlib/fix/math_constants_availability.hpp> // M_PI
#include <wx/wx.h> // Includes <windows.h> :(
------------------------------------------------------------------------
 
 
[snipalot]
 
Mr. Flibble, please quote only relevant stuff, but do quote that.
 
 
> Alf, why do you think anyone would be interested in this old way of
> doing things
 
Because AFAIK there aren't any viable modern alternatives except maybe
your library. Which I haven't tried, sorry. Well, and maybe the
Ultimate++ which likewise I haven't tried, but for different reasons.
 
Wikipedia's list: <url:
https://en.wikipedia.org/wiki/List_of_platform-independent_GUI_libraries>
 
 
> and the post in general?
 
GUI is one of the most often asked questions about C++. How does one do it?
 
 
> These days people use Qt (or soon my lib, neoGFX).
 
I don't like Qt. For one thing, its preprocessing, the `moc` compiler.
For another, the idea of dynamic type checking. Third, I remember years
ago when I tried to install it, the installation dialog failed to handle
the backspace key, typical for originally Unix-land code incompetently
ported to Windows (I don't recall exactly if it also had problems with
spaces in paths, but probably, it's in that general territory). Fourth,
their old white papers, pretending to have some have academic reasons
for the ungood design. That's also an incompetence indicator, defending
the bad decisions with academic nonsense that /looks/ impressive. Fifth,
that it's 1990's tech.
 
wxWidgets is also 1990's, but it's not Qt. :)
 
Do you have a tree view in neoGFX?
 
 
Cheers!,
 
- Alf
Paavo Helde <myfirstname@osa.pri.ee>: Jul 30 10:49AM +0300

On 29.07.2018 15:48, Alf P. Steinbach wrote:
> with FLTK).
 
> So I switched to wxWidgets as portable GUI framework, because Qt has
> that decidedly uncute preprocessing, a custom language dialect.
 
I have tried to stay clear from GUI programming as much as possible
though there is an old legacy MFC app which I have been supporting and
occasionally extending for the last 15 years. But recently I was tasked
to rewrite a small GUI tool on Windows because the existing tool only
worked on a 32-bit Mac, a dead platform (and they were afraid the single
computer we had somewhere might die soon as well).
 
I think they expected me to use C# or Java or a Powershell script
because nobody makes GUI programs in C++ any more, right? But as a C++
guy and believing in portability I chose wxWidgets instead, partially
because the wxWidgets libraries happened to be already there for
satisfying some third-party dependencies.
 
Instead of trying to read through all the docus and build the app from
the scratch I just took some of their examples and massaged it until it
did the needed thing. So I did not encounter any problems with main(),
_UNICODE or <windows.h>, these were all resolved or avoided in the example.
 
To be honest, I expected something more fancy. Instead I basically found
the same old MFC, just cleaned up and regularized a bit. WxWidgets
relies heavily on macros as well (BEGIN_EVENT_TABLE, EVT_BUTTON, etc).
Also, instead of main() I seem to have something like IMPLEMENT_APP(MyApp).
 
So, the thing worked, but the experience was not so great. I hope to
avoid GUI programs also in the future, but if this happens to be not
possible, I will probably try out some other framework, maybe Flibble's
neoGFX?
Christian Gollwitzer <auriocus@gmx.de>: Jul 30 10:02AM +0200

Am 30.07.18 um 03:48 schrieb Alf P. Steinbach:
 
> I don't like Qt. For one thing, its preprocessing, the `moc` compiler.
> [...]
 
> wxWidgets is also 1990's, but it's not Qt. :)
 
wxWidgets uses a very obsolete technique to handle event bindings. These
static event tables are quite inflexible and cumbersome once they become
larger.
 
You could have a look at "gtkmm", which uses libsigc++ for event
handling. It is based on C++ template features and achieves the same
flexibility as in QT with the moc. The moc was necessary back then when
they designed Qt, with today's C++ it is not longer necessary. They just
don't want to switch for compatibility reasons.
 
Christian
woodbrian77@gmail.com: Jul 30 08:47AM -0700

On Sunday, July 29, 2018 at 9:42:17 AM UTC-5, Mr Flibble wrote:
 
 
> Alf, why do you think anyone would be interested in this old way of doing
> things and the post in general?
 
Not everyone is able to use the latest tech.
I'm wondering if 2011 C++ is the new C.
 
 
 
Brian
Ebenezer Enterprises - "Do not boast about tomorrow, for you do
not know what a day may bring." Proverbs 27:1
 
http://webEbenezer.net
Melzzzzz <Melzzzzz@zzzzz.com>: Jul 30 05:27PM

> with FLTK).
 
> So I switched to wxWidgets as portable GUI framework, because Qt has
> that decidedly uncute preprocessing, a custom language dialect.
 
You don't have to use qt's signal/slot at all.
Some 20 years ago I just overrode event() virtual function
of application and used my own event handling.
Also you can override per object.
 
> EVT_MENU( wxID_EXIT, Main_window::on_cmd_exit )
> EVT_MENU( wxID_ABOUT, Main_window::on_cmd_about )
> wxEND_EVENT_TABLE()
 
MFC anyone? ;)
 
--
press any key to continue or any other to quit...
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 30 10:52AM

On Mon, 2018-07-16, Andrew Goh wrote:
> c++ is quite as 'native' to me, i'd guess most 'java programmers'
> (and so do other similar managed languages) are somewhat spoilt by
> garbage collection.
 
Then you should use the things discussed above with care. A lot of
C++ code doesn't need ownership-by-pointer at all; things are often
owned by being on the stack, or owned by some other object, or owned
by a std::vector or similar.
 
Smart pointers are useful, but don't use them to pretend it's
Java or Python. Strict and rigid ownership is a good thing,
in the scenarios where it works.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
woodbrian77@gmail.com: Jul 30 08:10AM -0700

On Monday, July 30, 2018 at 5:52:21 AM UTC-5, Jorgen Grahn wrote:
> by a std::vector or similar.
 
> Smart pointers are useful, but don't use them to pretend it's
> Java or Python.
 
The developer of unique_ptr describes a good alternative
to unique_ptr here:
https://stackoverflow.com/questions/38780596/how-to-handle-constructors-that-must-acquire-multiple-resources-in-an-exception#38780597
 
I sometimes use unique_ptr, but not that often.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
https://github.com/Ebenezer-group/onwards
Jeff-Relf.Me @.: Jul 30 06:15AM -0700

Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 30 10:07AM

On Tue, 2018-07-17, Adam Wysocki wrote:
 
> What is your preference towards indenting contents of namespaces?
 
> Although I find indented blocks easier to read (easier to see that this is
> in fact part of the namespace),
 
Me too. "Don't indent namespaces" has been the rule at work (2/2
places which used modern C++) but I can't get used to it. It's a
block of related stuff; I want the indentation to reflect that.
 
For example, I can't get used to seeing:
 
};
}
 
I remember not indenting them when I first started using them, in 2002
or so. My books indented namespaces; my editor defaulted to indenting
namespaces ... it seemed like a dumb idea to, as a newbie, start by
breaking existing conventions.
 
I don't see any negative effects of indenting. For me, it mostly
affects header files and anonumous namespaces, and I never nest them
very deeply.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
boltar@cylonHQ.com: Jul 30 11:24AM

On 30 Jul 2018 10:07:40 GMT
 
>Me too. "Don't indent namespaces" has been the rule at work (2/2
>places which used modern C++) but I can't get used to it. It's a
>block of related stuff; I want the indentation to reflect that.
 
The problem is that namespaces usually extend over 1 or more files so if you
indent everything in a namespace you often indent almost every line in a file
which IMO is rather pointless and leads to reduced readability.
Paavo Helde <myfirstname@osa.pri.ee>: Jul 30 10:02AM +0300

On 30.07.2018 0:30, jacobnavia wrote:
 
> This is another sign of the triumph of form over functionality. Of looks
> over substance, an example of our time.
 
Beauty requires sacrifice, eh?
 
Nothing new here, women have used neck rings, lip plates and foot
binding for ages. Not to speak about peacock tails. Not to speak about
all those tall church towers which used to catch the lightning so well.
Manfred <noname@add.invalid>: Jul 30 01:22PM +0200

On 7/29/2018 11:30 PM, jacobnavia wrote:
> This is another sign of the triumph of form over functionality. Of looks
> over substance, an example of our time.
 
But back in time Aristotle considered /form/ and /matter/ as the
constituents of /substance/, i.e. the indivisible union of form and matter.
This because the union of the form of and object and its matter are the
defining factors of the object itself.
 
Ironically, this is not just theoretical old philosophy, it sounds like
something that nowadays' marketing guys know very very well ;)
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.

Sunday, July 29, 2018

Digest for comp.lang.c++@googlegroups.com - 5 updates in 3 topics

jacobnavia <jacob@jacob.remcomp.fr>: Jul 29 11:30PM +0200

My computer?
 
I love it thin, very thin.
 
Elegant, it has a loooooook that kills everyone at the office.
 
How nice, slim, modern, light, ready to be carried in your big pockets
since it is, of course, over-priced and under-clocked.
 
Unable to cool it because of its stupid design, apple hardware like the
new Macbook pro starts GREAT and is incredible fast... the first 3-4
minutes. But under any heavy load (and sometimes even without it) it
must be throttled down (underclocked) to avoid a meltdown.
 
A meltdown like the fated Samsung phone, that caught fire everywhere and
was an industrial accident of huge proportions. I promess to you, I did
not laugh.
 
:-)
 
But it was somehow comic, excuse me.
 
It was thin, bigest screen, biggest CPU etc. It was aesthetically
correct but... caught fire sometimes!
 
Or the Mac Pro 2013, that had the same problem, happily it was so
overpriced that I couldn't afford it. Some years later an Apple engineer
admitted that they had "painted themselves in a thermal corner".
 
But it had a GREAT look, one user reported that his grandmother filled
it with water thinking it was some flower pot.
 
Aesthetically correct hardware for trendy users with big pockets that
doesn't work, but that's not so important. It looks great.
 
For heavy use, if you want the screaming fast CPU at full speed, buy a
big machine that can evacuate the heat produced by your brand new CPU.
 
For instance you can impress your friends with a liquid cooled machine
(the tubes are iluminated in green or red to better impress them). That
big machine will make them understand that they are talking to a real geek.
 
Happily for me, those machines are over-clocked but also over-priced. I
can't afford them.
 
So, I have to limit myself to low end gaming PCs that do not impress
anyone. I try to find some relief with the fact that my machines are
just as fast as the gamer ones, except the "special effects" of course.
 
But the CPU is screaming fast, never under-clocked because of heat
problems. And they are quite cheap, available everywhere...
 
This is another sign of the triumph of form over functionality. Of looks
over substance, an example of our time.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 29 02:48PM +0200

I started with the FLTK GUI framework for the little thing I'm
hobby-working on at the moment on. But then I discovered that the main
widget I needed, a tree view, was nowhere to be found in FLTK, although
there had been a version with that widget (which google found
initiallly, which is why I felt confident enough to just start coding
with FLTK).
 
So I switched to wxWidgets as portable GUI framework, because Qt has
that decidedly uncute preprocessing, a custom language dialect.
 
I remembered from some 10-15 years ago, whatever, that wxWidgets has a
problem with global variables and the static initialization order
fiasco. That hasn't bitten me yet, but there was a problem with its main
header including `<windows.h>` in Windows. That's a lot of macros! Like
a zillion. Also it did it in a way that produced a compilation error
within some Windows header dragged in by <windows.h>. The solution: to
define `WIN32_LEAN_AND_MEAN`.
 
Also, I discovered, `_UNICODE` (not just `UNICODE`) needs to be defined
to make the wxWidgets environment detection scheme work.
 
Oh, and there was an issue with <wx/setup.h>, which is not found via the
ordinary general include path, but requires its own special include
path, down in [wxWidget root]/lib/vc_lib/mswu. Not a bad idea for
configuration. But it wasn't so clearly documented. I think tutorials
should explain things like that. The critical showstopper things.
 
Even with those fixes the example "Hello, world!" code I found in the
short-short tutorial at <url:
http://docs.wxwidgets.org/stable/overview_helloworld.html> didn't build
as a Windows console program. Uh oh, no `main` function! So what should
go in `main` for a wxWidgets app?
 
For that i dived into the macros that didn't quite work, and hopefully
reproduced the same code execution via `main`. wxWindows appears to be
built of macros, a very very 1990s approach. It so far appears very
MFC-ish, including "message maps" for mapping events to handlers.
 
For the release version in Visual Studio I linked with wxbase31ud.lib,
wxmsw31ud_core.lib, wxpng.lib, wxzlib.lib, kernel32.lib, user32.lib,
gdi32.lib, comdlg32.lib, comctl32.lib and rpcrt4.lib, which appears to
be minimal, roughly.
 
Anyway here's my result code, the tutorial's code fixed so that it
works, and re-styled to more like my code (he he), a working wxWindows
"Hello, world!" for Windows:
 
 
-----------------------------------------------------------------------
#include <stdlib/extension/type_builders.hpp> //
https://github.com/alf-p-steinbach/Wrapped-stdlib
using namespace stdlib::ext::type_builders;
 
// The following two macros defined by <wrapped-windows/windows-h.hpp>:
// WIN32_LEAN_AND_MEAN avoids dragging in buggy part of <windows.h>
// _UNICODE makes wxWidgets macro scheme work.
#include <wrapped-windows/windows-h.hpp> //
#include <wx/wx.h> // Includes <windows.h> :(
 
struct Cmd_id
{
enum Enum
{
hello = 1
};
};
 
class Main_window: public wxFrame
{
void on_cmd_hello( wxCommandEvent& )
{
wxLogMessage( "Hello world from wxWidgets!" );
}
 
void on_cmd_exit( wxCommandEvent& )
{
Close( true );
}
 
void on_cmd_about( wxCommandEvent& )
{
wxMessageBox( "This is a wxWidgets' Hello world sample",
"About Hello World", wxOK | wxICON_INFORMATION );
}
 
wxDECLARE_EVENT_TABLE();
 
public:
Main_window( const wxString& title, const wxPoint& pos, const
wxSize& size ):
wxFrame( nullptr, wxID_ANY, title, pos, size )
{
const ptr_<wxMenu> file_menu = new wxMenu;
file_menu->Append( Cmd_id::hello, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu
item");
file_menu->AppendSeparator();
file_menu->Append(wxID_EXIT);
const ptr_<wxMenu> help_menu = new wxMenu;
help_menu->Append( wxID_ABOUT );
const ptr_<wxMenuBar> menu_bar = new wxMenuBar;
menu_bar->Append( file_menu, "&File" );
menu_bar->Append( help_menu, "&Help" );
SetMenuBar( menu_bar );
CreateStatusBar();
SetStatusText( "Welcome to wxWidgets!" );
}
};
 
wxBEGIN_EVENT_TABLE( Main_window, wxFrame )
EVT_MENU( Cmd_id::hello, Main_window::on_cmd_hello )
EVT_MENU( wxID_EXIT, Main_window::on_cmd_exit )
EVT_MENU( wxID_ABOUT, Main_window::on_cmd_about )
wxEND_EVENT_TABLE()
 
class App: public wxApp
{
public:
auto OnInit()
-> bool override
{
const ptr_<Main_window> window =
new Main_window( "Hello World", wxPoint( 50, 50 ), wxSize(
450, 340 ) );
window->Show();
return true;
}
};
 
// wxIMPLEMENT_APP(App);
wxIMPLEMENT_WX_THEME_SUPPORT // Does nothing in Windows. :(
 
auto main()
-> int
{
wxDISABLE_DEBUG_SUPPORT(); // Don't know why, but that's in
wxIMPLEMENT_APP.
wxApp::SetInitializerFunction( []() -> ptr_<wxAppConsole> { return
new App; } );
return wxEntry(); // Undocumented, uses process arguments.
}
-----------------------------------------------------------------------
 
 
Cheers!,
 
- Alf
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 29 03:05PM +0200

On 29.07.2018 14:48, Alf P. Steinbach wrote:
> wxmsw31ud_core.lib, wxpng.lib, wxzlib.lib, kernel32.lib, user32.lib,
> gdi32.lib, comdlg32.lib, comctl32.lib and rpcrt4.lib, which appears to
> be minimal, roughly.
 
Oh, that was for the debug version, sorry. Copy+paste-error.
 
Cheers!,
 
- Alf
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 29 03:42PM +0100

On 29/07/2018 13:48, Alf P. Steinbach wrote:
>     return wxEntry();           // Undocumented, uses process arguments.
> }
> -----------------------------------------------------------------------
 
Alf, why do you think anyone would be interested in this old way of doing
things and the post in general?
 
These days people use Qt (or soon my lib, neoGFX).
 
/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."
Thomas Kaufmann <tokauf@gmail.com>: Jul 29 07:26AM -0700

Barry: it works. THANK YOU!
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.