Project

General

Profile

Actions

Task #3419

closed

Replace include guards with #pragma once

Added by Davide Pesavento over 8 years ago. Updated about 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Docs
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Although non-standard, #pragma once is widely supported by C/C++ compilers on several platforms. Moreover, it has several advantages over classic include guards:

  • it's shorter to type
  • less error-prone (typos...)
  • no need to come up with a unique (and long) macro name
  • nothing to change when the header is renamed or moved
Actions

Also available in: Atom PDF