DEV Community

#ifndef guards vs. #pragma once

fluffy on December 07, 2018

After getting in an extended discussion about the supposed performance tradeoff between #pragma once and #ifndef guards vs. the argument of correct...
Collapse
 
cctechwiz profile image
Josh Maxwell

Thanks for the concrete comparisons.

I agree that the most worrisome thing about #pragma once is that it is not standardized, and will probably never be. I definitely prefer the way #pragma once looks in code, but can't justify using something that I have no control over in the long run.