How to disable inclusion of header when using `#pragma once` (similiary to when using include guards)?

126 Views Asked by At

From time to time I have to retrofit unit testing into an unfriendly environment.
In these cases include guards are pretty useful, because:

  1. I could suppress inclusion of unwanted header file,
  2. I could check whether specific file was (not)included into test environment.

It seems that both these options are gone with #pragma once.

Are there any workarounds beyond replacing #pragma with guards for critical files?

0

There are 0 best solutions below