C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Preprocessor

From: bmon Dor <dorbmons_at_[hidden]>
Date: Mon, 14 Aug 2023 16:09:27 +0800
Why not just use #include "output/messages/messageData1.h"
or just write a messageData.h in "output/messages/" with code:
`
#include "messageData1.h"
#include "messageData2.h"
`

BAMBYK via Std-Proposals <std-proposals_at_[hidden]> 于2023年8月14日周一
12:57写道:

> We often surround out code into separated folders. And we always must
> write the path to the folder before a file we want to include. You may use
> -I flag but it is not clearly comfortable. This feature would lead to
> better code structure and faster include.
>
>
> #go "output"
> // output
> #include "helloWorld.h"
> #go "messages"
> // output/messages
> #include "messageData1.h"
> #include "messageData2.h"
> #exit
> #exit
>
>
> In this example #go means set folder the files are included from. The
> compiler simply adds "path + '/' before each include. The #exit quit from
> previous #go block.
> These keywords can be nested the same as directories. So the nested #go
> affect each other. It does not affect at anything else.
>
>
> Of course any path can be specified:
>
> #go "output/messages"
> #include "messageData1.h"
> // ...
> #exit
>
>
> if the directory has only alphanumeric characters it can be used without
> quotes.
>
> #go output
> // ...
> #exit
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-08-14 08:09:41