You can nest things as you like within #if.  (Whitespace is not significant in C++.)

On Tue, Dec 13, 2022 at 5:13 PM Michael Levine via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I propose that we introduce the following new preprocessor conditional inclusion syntax:

    condexpr if (expression or identifier, expression or identifier...) {
        ....the conditional logic....
    }

New keyword to reserve:  condexpr

Some advantages:
  - The syntax looks more like standard C++ code and less like preprocessor directives
  - Rather than writing the preprocessor conditional inclusion syntax like #ifdef and #endif at the beginning of each line, which breaks the flow of code if the code is already nested, this syntax can be written directly into the regular C++ code.

Here is how I would rewrite most of the example from the Conditional Inclusion page here (https://en.cppreference.com/w/cpp/preprocessor/conditional) using this new syntax:

#define ABCD 2
#include <iostream>
 
int main()
{
 
condexpr if (ABCD)
{
    std::cout << "1: yes\n";
}
else
{
    std::cout << "1: no\n";
}
 
condexpr if (!ABCD)
{
    std::cout << "2: no1\n";
}
elif (ABCD == 2)
{
    std::cout << "2: yes\n";
}
else 
{
    std::cout << "2: no2\n";
}
 
condexpr if (!(DCBA) && (ABCD < 2*4-3))
{
    std::cout << "3: yes\n";
}
 
condexpr if (CPU)
{
    std::cout << "4: no1\n";
}
elif (GPU) 
{
    std::cout << "4: no2\n";
}
elif (!RAM)
{
    std::cout << "4: yes\n"; 
}
else
{
    std::cout << "4: no!\n";
}                         
 
}
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals