Closing questions does not mean they are off topic
It is perfectly acceptable, and in fact a vitally necessary part of the ordinary operation of the site, to close on topic questions. This happens when the question meets any other criterion for closure, including being unclear, unfocused or lacking in debugging details. (Of course, duplicates are also closed as duplicates, directly routing them to an existing answer.)
Questions that fail to meet standards must be closed as quickly as possible, so that people who incorrectly want to try to answer them (which interferes with the normal working of the site) don't get a chance.
Question closure is injunctive, not punitive. Preventing answers is the primary goal.
When a question is immediately closed, generally the OP has at least 9 days to at least attempt to edit it (or someone else can cast a reopen vote regardless) before it gets deleted automatically. If the question gets a positive score, it will hang around for at least a year (this requires a +2 if the OP's account is deleted). It will furthermore hang around indefinitely if it gets at least two undeleted comments, which is usually the case (because people will comment to try to figure out how to fix the question).
Even supposing we ignore the questionable context for the problem described, the question remains whether OP is trying to figure out the version at compile time or at runtime; whether the code needs to do something at runtime based on that behaviour or if it will be used for some kind of build-time preprocessing, etc. These details need to be clarified. For that matter, depending on the answers, the question could be a duplicate. (For all I know, anyway. I don't know anything relevant about log4cxx, but I take @vandench's analysis for granted.)
This question should not be speedily deleted
It seems very likely to me that the question can be appropriately clarified. Communication will be needed to determine whether OP (a) has an XY problem; (b) cares about such a problem (it is perfectly legitimate to ask "how do I do Y?" even if you determine that the actual problem in your actual code is X - just as it is legitimate to ask even if you did not personally encounter a problem at all).
LayoutPtr
typedef? There's a lot of elements of that question that need to be clarified before it can be answered.