i created a class in visual studio c++ and realized that it added a single '#pragma once' to the start of the header file, what is the difference between #pragma once and header guards that use preprocessor conditionals?
i am guessing that it is used as a replacement for header guards but i am not sure how does #pragma once work or does it create any differences in performance,portability,etc... also i don't know which one is better to use in header files
// what i get when i use the visual studio c++ class wizard
#pragma once
// what i was taught in class
#ifndef HEADER_FILE
#define HEADER_FILE
//some code
#endif //HEADER_FILE