Skip to content

Commit 45a5c6e

Browse files
konardclaude
andcommitted
Add #pragma once to all header files
This change implements the LinksPlatform decision to use #pragma once instead of traditional header guards in all C++ headers. The following files were updated: - cpp/Platform.Ranges/Range.h: Added #pragma once - cpp/Platform.Ranges/Range[T].h: Added #pragma once - cpp/Platform.Ranges/EnsureExtensions.h: Added #pragma once - cpp/Platform.Ranges/RangeExtensions.h: Added #pragma once - cpp/Platform.Ranges.Tests/pch.h: Replaced traditional guards with #pragma once This provides cleaner, more maintainable header protection across the codebase while ensuring compatibility with modern C++ compilers. Fixes #43 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 80c8fe9 commit 45a5c6e

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

cpp/Platform.Ranges.Tests/pch.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
55
// Do not add files here that you will be updating frequently as this negates the performance advantage.
66

7-
#ifndef PCH_H
8-
#define PCH_H
7+
#pragma once
98

109
// add headers that you want to pre-compile here
11-
12-
#endif //PCH_H

cpp/Platform.Ranges/EnsureExtensions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Platform::Ranges::Ensure::Always
1+
#pragma once
2+
3+
namespace Platform::Ranges::Ensure::Always
24
{
35
const std::string DefaultMaximumShouldBeGreaterOrEqualToMinimumMessage = "Maximum should be greater or equal to minimum.";
46

cpp/Platform.Ranges/Range.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Platform::Ranges
1+
#pragma once
2+
3+
namespace Platform::Ranges
24
{
35
#define LIMIT_AS_RANGE(type) std::numeric_limits<type>::lowest(), std::numeric_limits<type>::max()
46

cpp/Platform.Ranges/RangeExtensions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Platform::Ranges
1+
#pragma once
2+
3+
namespace Platform::Ranges
24
{
35
template<typename T> requires requires(T a, T b) { a - b; }
46
auto Difference(Range<T> range)

cpp/Platform.Ranges/Range[T].h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Platform::Ranges
1+
#pragma once
2+
3+
namespace Platform::Ranges
24
{
35
namespace Internal
46
{

0 commit comments

Comments
 (0)