What you are trying to do won’t work - #include
directives are not processed at runtime, but during the pre-processing phase of compilation. IOW, you can’t execute an #include
directive in a running program.
The question is why you want to do this - what problem are you trying to solve? If you honestly have a situation where you to choose between multiple headers based on some condition, then you’ll have to write a program to generate that code and then compile the generated code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…