Building C++ modules
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Aug 13 19:37:53 UTC 2019
On Tue, Aug 13, 2019 at 06:51:10PM +0000, Patrick Schluter via Digitalmars-d wrote:
> On Tuesday, 13 August 2019 at 15:21:56 UTC, H. S. Teoh wrote:
[...]
> > It's not so simple. The problem is that in C++, the *structure* of
> > the parse tree changes depending on previous declarations. I.e., the
> > lexical structure is not context-free.
[...]
> I love the
>
> fon< fun< 1 >>::three >::two >::one
>
> expression in C++ from Jens Gustedt's blog [1]
>
> There the expression means something different in C++98 than in C++11
>
> Let’s have a look how this expression is parsed
>
> 1 fon< fun< 1 >>::three >::two >::one // in C++98
> 2 -----------
> 3 -----------------------
> 4 -----------------------------------
> 5
>
> 1 fon< fun< 1 >>::three >::two >::one // in C++11
> 2 --------
> 3 ---------------------
> 4 ----------------------------
> 5 -----------------------------------
>
>
> [1]: https://gustedt.wordpress.com/2013/12/18/right-angle-brackets-shifting-semantics/#more-2083
Yeah, it's things like this that convinced me that C++ is hopelessly and
needlessly over-complex, and that it was time for me to find a better
language. Like D. :-D
Using <> as delimiters for template arguments must have been one of the
biggest blunders of C++, among many other things.
T
--
Recently, our IT department hired a bug-fix engineer. He used to work for Volkswagen.
More information about the Digitalmars-d
mailing list