Skip to content

Convert to #pragma once#1898

Open
white238 wants to merge 4 commits into
developfrom
task/white238/pragma_once
Open

Convert to #pragma once#1898
white238 wants to merge 4 commits into
developfrom
task/white238/pragma_once

Conversation

@white238

Copy link
Copy Markdown
Member

Converts all headers to #pragma once. There were a couple places that were missing guards. I also didn't touch src/thirdparty and src/cmake.

@rhornung67

Copy link
Copy Markdown
Member

@white238 #pragma once isn't an C++ standard feature. Granted, it's cleaner than the macro guard approach, but could this cause a problem in some circumstances; e.g., sym links, moving files during the build-install process?

@kennyweiss kennyweiss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @white238

This should improve consistency (as much fun as it is coming up w/ slightly inconsistent header guards for each file).

There are a few cases where the guard was a a few lines lower than it should have been. These predate your PR, but this would be a good time to fix them.

Comment thread src/axom/core/numerics/Matrix.hpp Outdated

#ifndef AXOM_MATRIX_HPP_
#define AXOM_MATRIX_HPP_
#pragma once

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This predates the current PR, but the #pragma once should be above the includes in this file.

Comment thread src/axom/inlet/inlet_utils.hpp Outdated
Comment thread src/axom/sidre/core/AttrValues.hpp Outdated
Comment thread src/axom/slam/examples/tinyHydro/VectorXY.hpp Outdated
Comment thread src/axom/slic/interface/c_fortran/wrapSLIC.h Outdated
@white238

Copy link
Copy Markdown
Member Author

pragma once is supported by all major compilers at this point and removes the possibility of copy/paste issue. There is a possibility that if you mix symlinked and non-symlinked header it would include it and add a bit to the compile time. But personally i think its more likely we mess it up.

It is a very common feature at this point, more concise, and possibly speeds up builds.

@Arlie-Capps Arlie-Capps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Chris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants