I want to automatically insert include guards into newly created header files in Visual Studio 2012. Is there any predefined snippet for this purpose?
EDIT: I'm aware of #pragma once and its wide support by compilers. But our coding style forces me to use include guards.
In visual studio 2012 use the key combinations
Ctrl+K,Ctrl+S
It allows you to surround selected code with code snippets such as:
#if
, #ifdef
, #ifndef
, if
, class
, do
, enum
, and many more
.. or specify your own: http://msdn.microsoft.com/en-us/library/ms165394.aspx
#pragma once
?
But no, I'm not aware of anything that automatically inserts the #ifndef
, etc. for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With