last day (16 days later) » 
19:00 - 21:0021:00 - 00:00

7:37 PM
5
A: Why return-type 'cv' is ignored?

ColumboAfter considering the quote mentioned by @dyp, which is [expr]/6: If a prvalue initially has the type “cv T,” where T is a cv-unqualified non-class, non-array type, the type of the expression is adjusted to T prior to any further analysis. The conclusion is rather simple: As the ex...

 
dyp
And this is indeed one of the weirdest rules I've encountered in C++. I think I've learned it when trying to bind to an lvalue reference where the type is deduced: auto& x = g(); doesn't work if g returns a const non-class type.
 
@dyp By now I feel like one could write a short book about rules of reference initialization. It gets more complicated each time I try to provide analyses. (Btw: Thanks for correcting me. :o))
 
dyp
Probably, the reason is that prvalues of non-class non-array type are immutable - they're values, not objects. Even if we try to bind them to rvalue refs, they're not directly bound, but an object which is initialized with them. Methinks prvalues of non-class non-array types are treated as true values, not objects.
Yes, the whole initialization topic is rather complicated. Recently, I've argued that function lvalues appear in ref init because there are no rvalues of function type. It sometimes seems like a gathering of obscure parts of the language.
 
@dyp So you're saying there is no fundamental difference between an integer literal and a constant expression prvalue of integral type? (Apart from the funny fact that the latter is not allowed as a null-initializer for pointers)
(Because an integer literal is IMO the best example for pure "valueness" in C++.)
@dyp Well, the term "value" doesn't really apply to functions, so it's nonsensical to talk about lvalues of function type. You can't put a function on the left-hand side of an assignment, IIRC
 
dyp
Hmm. They're different kinds of expressions, for example (grammatically). For class types and arrays, we need to be able to get pointers, so they cannot be values to the same degree that the other types can.
The "value" part in value categories is a misnomer nowadays, anyway. They're expression categories, and there surely are function expressions.
No, you can't assign to a function, but you can't assign to an array either. Yet, both are lvalues.
(Try to look up why you can't assign to an array. IIRC, you have to get back to the C spec o.O)
"the latter is not allowed as a null-initializer for pointers" Huh? It was, at least originally. I remember there's a defect related to that.
 
7:42 PM
@dyp Yeah, I meant that they are misnomers.
There are far too many misnomers in the standard, though, tbh
@dyp Ehh, you're kidding, right? Haha
 
dyp
No, unfortunately we could write struct X { int z; }; char* p = X{}.z; IIRC
 
Why would anyone change that to not allowing constant integral expressions
 
dyp
change what? null pointer constant?
 
@dyp Precisely
Oh, there is the DR
Overlooked that
 
dyp
<strike>Have you read the DR?</strike> I've also seen a talk some time ago where another problem was mentioned
For pure virtual functions, virtual .. = 0 is not an expression. The 0 there is not a value, but some grammatical feature. Let me fetch my D&E
 
7:45 PM
@dyp Yeah, I know
That was a joke ;)
The pure-specifier is defined as = 0
 
dyp
well, arguably, = nullptr could also be fine.
(as a future extension to C++)
 
@dyp I'd prefer a context-dependent keyword pure: pure virtual void f(); What do you think?
I mean, that can impossibly break earlier code, can it
(And I hope noone uses lower-case macros)
 
dyp
I just wanted to suggest the same :) but I think I've read that somewhere before, though I'm not sure if it was an official proposal. You could also write the slightly uglier virtual void f() = pure; which I think doesn't cause ambiguities
 
@dyp Btw, what do you think of the proposed std::string_literal? I emailed Richard Smith yesterday and based on feedback he got from the EWG it's likely to be accepted
 
dyp
Huh? Haven't read about that before... sounds like the type for a UDL for type-safe string literals?
do you have a document number or a link?
 
7:51 PM
@dyp Something like that - it's basically a class template to hold constant char arrays, usable in constant expressions
^ Proposal
Yeah, I'm sure there is also a UDL for those
I mean, why the hell not
 
dyp
Hm? Currently, you can't expand a string literal to template arguments, not even with UDL, AFAIK
 
@dyp Erm, yes, I did that with C++11
With binary recursive macros and trimmer templates
 
dyp
yeah... with macros... :)
 
@dyp hihi
Yeah, they solve the unsolvable
 
dyp
shameless plug - I should do some advertisement for my HTML version of the C++ draft; with (basic, bad) support for conversion to SO compatible markup - it still needs some work, which means help
 
7:54 PM
But still, it works perfectly and is practically sufficient
@dyp Why didn't you mention that earlier, haha
Did you write a program to convert the PDF file to an HTML file?
 
dyp
The problem is that the standard draft sources are under a weird ISO copyright, so I can't publish the HTML result :(
 
@dyp lol what
Then get a damn allowance!
This would be really useful
I hate retyping all formatting stuff myself
 
dyp
"I hate retyping all formatting stuff myself" That was the main reason why I started the project xD
I first tried to convert PDF to text, but wasn't satisfied with the result
 
@dyp Of course, working with that is probably quite hard
@dyp OMG "International Standard ISO/IEC 14882:2012"
 
dyp
xD
 
7:57 PM
What the - so we have C++12 and C++15!?
 
dyp
In the ISO etc. archives, I could find some other weird versions of drafts that were withdrawn..
 
@dyp (Psst: Can't you send me the prototype HTML version? I promise I won't spread it!)
 
dyp
Well, for the conversion of the drafts, I found a tool that converts latex to XML. But that still needed a lot of work, since I wanted to extract the meaning of the macros used, not just the formatting (extracting the formatting is also not simple). So I build a tool chain for latex -> XML, then XML -> HTML. github.com/dyp-cpp/draft2html5 Unfortunately, it's not as easy to install as it should be (and I can't publish the results myself)
you can build the tool chain and use it, then report back to me what problems occurred :)
 
@dyp Wait, you're german!?
 
dyp
huh? how did you find that out?
 
8:00 PM
@dyp You use GMX
 
dyp
they offer their services world wide
 
@dyp ... wait
I'm starting to see a correlation
@dyp Are you camper?
 
dyp
uhhh no?
 
Or do you know anyone that uses "camper" as an account name somewhere?
 
dyp
no o.O
 
8:02 PM
I'm so sure he's on SO, but I just cannot figure out who he is :(
It's this guy in our forum
Who is a brilliant language lawyer and C++'ler
 
dyp
"our forum"?
 
@dyp c-plusplus.net (I moderate in the C++ board there)
I know he is on SO, I just know it
Maybe he's TC, or hvd
 
dyp
I think I figured out that Potatoswatter is daniel kruegler, but that's about all. Andrew Tomaszos also had a weird user12458 account on SO before he posted to the std-discussion and essentially reveiled himself :D
 
Anyway, back to your project
@dyp Wow, thanks, good to know
 
dyp
(not 100% sure, but strong correlation)
yeah, my project. I wrote to the committee last year and got some nice feedback, but achieved nothing. Should write again this year, and maybe to isocpp.org, they might publish it (essentially AFAIK you need to be a committee member to publish it)
 
8:05 PM
@dyp You're not?
XD
Wait, aren't there douzens of PDF->HTML converters!?
Why not convert the generated HTML from one of these into the HTML we want
 
dyp
If you look at the XML document output, you'll perhaps understand why/what I did.
I'll try to give an example..
<?xml version="1.0" encoding="UTF-8"?>
<document>
<section id="intro" position="1" level="0">
<title>
<text xml:space="preserve">General</text>
</title>
<section id="intro.scope" position="1.1" level="1">
<title>
<text xml:space="preserve">Scope</text>
</title>
<par number="1">
<text xml:space="preserve">This International Standard specifies requirements for implementations of the <cpp/> programming language. The first such requirement is that they implement the language, and so this International Standard also defines <cpp/>. Other requirements and relaxations of the first requirement appe
 
Yeah
So that is the output of a normal PDf->XML (/HTML) converter, or yours?
 
dyp
Essentially, I converted all latex macros to xml tags. That means that instead of <i>something</i>, I get markup like <variable>something</variable>
No, that's from the resulting XML document of my tool chain
Note the <cpp/> tag
 
@dyp Ahh
Yes
For quotes, or what? Marking where to start copying the code?
Wait, that would be nonsense
It would stop in the middle of the sentence
And right before punctutation :D
 
dyp
The conversion from latex -> XML is almost lossless, and intended to be completely lossless. That means, you can for example re-style the entire document in CSS, and give definitions of terms a different formatting than simple usages of terms.
Also, PDF -> HTML might have issues with the code samples.
Probably a better example: <definition position="1.3.4" level="2" id="defns.argument.templ">
<defines>argument</defines>
<explanation>
<text xml:space="preserve">&lt;template instantiation&gt; expression, <grammarterm xml:space="preserve">type-id</grammarterm> or <grammarterm xml:space="preserve">template-name</grammarterm> in the comma-separated list bounded by the angle brackets </text>
</explanation>
</definition>
 
8:11 PM
@dyp True, but I'd think of the following: Get the HTML output, and look for patterns, such as code samples. Then transform these according to SO-Markup. That at least sounds simple
@dyp Holy moly
 
dyp
The source latex:
\indexdefn{argument}%
\indexdefn{argument!template instantiation}%
\definition{argument}{defns.argument.templ}
<template instantiation>
expression,
\grammarterm{type-id} or \grammarterm{template-name} in the comma-separated
list bounded by the angle brackets
 
But you can still convert that, can't you? Replace all <grammarterm> tags with *text*, why doesn't that work?
 
dyp
Hm? once I have the XML, there's not much more to do. The issue is converting FROM latex, since latex uses macros.
 
@dyp But why bother converting in the first place, when the above Latex seems simple - replace \grammarterm{type-id} by *type-id*, e.g. - and so forth
Not trivial, but still manageable
AFAICS
 
dyp
This does work, but not always. Latex uses macros, which means (I'm no latex expert) that the interpretation of the source code can change after a macro invocation.
I did consider writing a latex parser for those documents, only supporting the subset of macros used in the std sources.
 
8:17 PM
@dyp Wait, what about the following: We just paste the text copy of the portion we want into a program that recognizes terms like type-id and automatically marks them italic? And recognizes code samples and formats them appropriately?
 
dyp
text copy? of the pdf output or the latex sources?
 
Would that work out, despite the immense effort of inserting all those words (which might be simplified by simply pasting the paragraphs in [gram])
@dyp The original PDF file, viewed in Evince
E.g.
A member of a class can be
(1.1) — private; that is, its name can be used only by members and friends of the class in which it is declared.
(1.2) — protected; that is, its name can be used only by members and friends of the class in which it is
declared, by classes derived from that class, and by their friends (see 11.4).
Is transformed to use bullet points
The main problem is stuff like comments
Because they ruin this idea
E.g.
class X { // X::a is private by default
int a;
};
struct S { // S::a is public by default
int a;
};
— end example ]
They're just in the wrong order
 
dyp
It's very likely that it can be done. I wanted to write something that can be maintained easily.
 
@dyp Yeah, good point.
 
dyp
Also, IMHO the formatting of the stdlib is quite broken :)
 
8:21 PM
@dyp stdlib? Or the standard?
 
dyp
the library part of the standard
 
@dyp What don't you like specifically then
I mean, it looks shit, but that is a matter of taste, e.g. whether { should get own lines or whether comments should be so far away from the end of the code line they correspond to
@dyp Wait, so are you, or not? Not sure what implications that response had :)
 
dyp
yes, I am, which makes it a bit weird that we're using English. But I'm used to it now anyway :)_
 
@dyp Nein, lassen wir den Unsinn
Obwohl es natürlich mein Vokabular fördert
 
dyp
ich habe aber keine lust jetzt anzufangen, die technischen ausdruecke zu uebersetzen. Da kommt meist grauenhaftes bei raus
 
8:24 PM
@dyp Was spricht den gegen Anglizismus?
 
dyp
(ich habe auch keine Umlaute auf meiner Tastatur - oder zumindest keine, dich ich schnell eingeben koennte)
 
Ich sage auch copy initialization statt Kopierinitialisierung, lol
@dyp Na gut, wenns dir nicht passt können wir gerne weiter in Englisch kollaborieren :)
 
dyp
Wenn man sich ueber die Sprache unterhaelt, kann es passieren dass auf einmal fast der ganze Satz wieder englisch wird.
mir egal :)
 
@dyp haha
Es ist echt verrückt mit dir Deutsch zu sprechen
 
dyp
:D ich versuche mein bestes, nicht als Deutscher aufzufallen (sprich: englisch sinnvoll anzuwenden)
ohje, gross/kleinschreibung.
 
8:26 PM
@dyp Das tut doch jeder hier der nicht Englisch als seine Muttersprache hat, mich inklusive
@dyp LOL
 
dyp
ich schreibe fast ausschliesslich auf englisch, bin es daher gar nicht mehr gewohnt, Substantive grosszuschreiben
 
Deutsch ist echt komplexer als Englisch, IMO
@dyp *Ich * Englisch *zu-viele-kommas
Ich werde zu einem Grammar-Nazi sobald auf Deutsch gesprochen wird
 
dyp
zu viele kommata?
 
@dyp Geht beides :o)
 
dyp
Satzanfaenge... nein, ich meinte, welche Kommas sind denn zu viel?
 
8:28 PM
@dyp Jetzt scheint das nicht mehr der Fall zu sein
Ich mag Kommata nicht
Ich setze stets zu wenig
 
dyp
zurueck zum Thema: [alg.copy] z.B. beschreibt mehrere funktionen in einem Abschnitt mit fortlaufenden Nummern.
Dabei haben die einzelnen Funktionen keine eigenen Nummern, sondern nur die Spezifikation dazu. Was dazu fuehrt, dass man die Nummern nicht mehr (automatisch) einer Funktion zuordnen kann.
 
@dyp Das ist aber auch einfach nur bescheuert vom Standard, haha
Oh Moment - deswegen zeigst du mir das ja :D
Ohne Witz, warum zum Teufel haben die das so gemacht?
 
dyp
Ausserdem finde ich die ganze Idee, das in einem fortlaufenden Text zu spezifizieren, nicht mehr wirklich zeitgemaess. cppreference finde viel besser verwendbar, aber nicht ganz so auf den Punkt wie die Spezifikation.
 
Das ist doch unsinnig
@dyp cppreference ist toll.
Echt so eine Referenz nach meinem Geschmack (als Junior Sprachanwalt)
 
dyp
Ich wuensche mir manchmal, man koennte den Standard, die DRs, die Infos aus D&E, proposals und diskussionen sowie cppreference miteinander verbinden..
.. in ein Dokument mit links.
 
8:34 PM
@dyp Eine Web-Seite? Das wäre echt Klasse
Am besten mit Suchfunktion via Google site:...
(Nicht ein Dokument mit nur einer Seite, das wäre unpraktikabel :D)
@dyp Mit links, he? :D
 
dyp
Es waere auch nicht weiter schwierig, die DRs mit dem Standard zu verbinden, weil die DRs meistens direkt einen Paragraphen spezifizieren. (Wenn man erst mal den Standard in einem sinnvollen Format hat - wie XML)
 
@dyp Man, weißte was echt der absolute Hammer wäre?
Eine Art HTML-Standard der neben jedem Paragraphen DRs, Modifikationen und künftige Proposals hat die sich darauf beziehen
oO
Schon fast surreal
 
dyp
Sowas hatte ich im Sinn
 
@dyp Vorstellen kann ichs mir, also muss es machbar sein
 
dyp
:D Ein Problem wird sein, dass sich die Nummern der Absaetze aendern.
 
8:37 PM
@dyp Warum zum Teufel denn das?
 
dyp
Sie aendern sich in verschiedenen draft-revisionen, z.B. weil neue Absaetze hinzukommen.
z.B. [expr]/6 von vorhin ist in C++11 nicht vorhanden.
 
@dyp Jo, das ist mir gerade klar geworden, jedoch nähme ich N4140 als Basis und mache für jeden einzelnen Absatz verfügbar wo und ob er im früheren Standard verfügbar war
 
dyp
"und mache für jeden einzelnen Absatz verfügbar" Und wie machst du das?
 
@dyp Mit so einem kleinen Knopf daneben, "Details anzeigen" :D
Achso, du meinst wie ich an die Info komme?
Naja, ich parse beide... Mist
Das wirft ja mehrere Komplikationen auf
 
dyp
diff oder aehnliche tools koennten helfen, aber das Resultat wird wahrscheinlich nicht perfekt sein.
DRs zu Abschnitten (Sektionen) linken laesst sich das schon ohne Weiteres mit meiner XML/HTML-Version des Standards machen. Man muesste nur die DRs parsen, was aber wahrscheinlich nicht so schwierig ist. Sie werden ja als HTML veroeffentlich; und die LWG DRs liegen sogar in einer XML-Version vor bei github.
 
8:42 PM
Levensthein-Distanz der einzelnen Absätze?
Wie lange man das dann rendern lassen müsste oO
 
dyp
Ich frage mich immer noch, was das hier ist: wg21.cmeerw.net/cwg und wie es zustande kommt. Es scheint eine Datenbank mit issues zu geben.
 
@dyp Was ist das überhaupt?
Und wo hast du das her?
Drübergestolpert?
 
dyp
Es tauchte mal in SO als links <strike>to</strike>zu issues auf. Ja, druebergestolpert.
 
@dyp Das ist ja Saugeil!
Geile Seite, die Bookmarke ich mir sofort
Wobei ich sowieso Bookmarks gar nicht verwende, lol
 
dyp
Schade nur, dass man nicht so schoen mit Ctrl-F suchen kann wie auf der open-std-Seite
 
8:48 PM
@dyp Kann man nicht ein Programm schreiben dass durch alle Seiten durchgeht und sucht?
172 Monate ist das älteste Issue alt, das sind doch so 14/15 Jahre
Klasse, echt
 
dyp
Warum nicht? Es ging mir bei der Bemerkung eher um Nutzbarkeit momentan.
 
@dyp Klar
Da hast du Recht.
 
dyp
Ein issue ueber das ich letztes Jahr gestolpert bin, ist die Spezifikation von matching bei partial specializations.
 
@dyp Ach, für diesen Mega-Post über partial ordering?
Da hat sogar hvd abgedankt
Moment, wg21.cmeerw.net/cwg/issue?@template=search habe ich total übersehen
So schlimm ist es dann nicht
 
dyp
Hmm da war kurze Zeit danach noch ein anderes Post ueber partial ordering... aber ich hab nochmal nachgeschaut, und es war doch nicht das issue, was ich gemeint hatte. Jemand hat mich mal auf ein 10 Jahre altes issue aufmerksam gemacht, bei dem ich nicht glauben koennte, dass es noch offen ist.
 
8:52 PM
@dyp Wie was
Welches
Warum woher
 
dyp
Wenn ich es finden koennte...
hm, nein, nicht auf die schnelle. Aber wenn man die issues mal nach activity und "status: open" sortiert, findet man schon einige merkwuerdige Sachen die schon sehr lange offen sind.
 
Hier, das ist so ein ganz typischer Thread mit camper
Übrigens, dieser Krümelkacker - der war richtig kompetent, und hat dann plötzlich angefangen Rust-Werbung reinzuspammen, überall!
Das war echt eine geile Sache :D
Mann, ich frage mich echt ob ich seine IP nehmen, zum Provider latschen und sie zurückverfolgen lassen soll
Dann hätte ich schließlich seine Identität binnen kurzer Zeit raus, AFAICS
Aber egal </OT>
@dyp Gute Idee.
 
dyp
das ganze hier ist OT :D
 
@dyp "21961 months ago"
Wie viele Jahre sind dass, Zwanzigtausend?
Scroll runter :D
 
dyp
Created on 0211-03-08
 
8:58 PM
@dyp Gerade gelesen
:D
 
dyp
Ich wusste ja, das C++ alt ist..
 
@dyp Da haben also diese Römer ihre Finger im Spiel gehabt! Ich wusste es!
 
dyp
Fuer die wahr bei deren Grammatik TMP wahrscheinlich auch nichts kompliziertes
 
19:00 - 21:0021:00 - 00:00

  last day (16 days later) »