Building C++ modules
Patrick Schluter
Patrick.Schluter at bbox.fr
Tue Aug 13 18:51:10 UTC 2019
On Tuesday, 13 August 2019 at 15:21:56 UTC, H. S. Teoh wrote:
> On Tue, Aug 13, 2019 at 11:19:16AM +0200, Jacob Carlborg via
> Digitalmars-d 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.
> For example, given this C++ code:
>
> [...]
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
More information about the Digitalmars-d
mailing list