diff --git a/src/config/Block.hxx b/src/config/Block.hxx
index 57f16b5f6..5dc0bb588 100644
--- a/src/config/Block.hxx
+++ b/src/config/Block.hxx
@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_CONFIG_BLOCK_HXX
-#define MPD_CONFIG_BLOCK_HXX
+#pragma once
 
+#include <concepts>
 #include <string>
 #include <vector>
 
@@ -45,7 +45,7 @@ struct BlockParam {
 	 * Invoke a function with the configured value; if the
 	 * function throws, call ThrowWithNested().
 	 */
-	template<typename F>
+	template<std::regular_invocable<const char *> F>
 	auto With(F &&f) const {
 		try {
 			return f(value.c_str());
@@ -130,5 +130,3 @@ struct ConfigBlock {
 	[[noreturn]]
 	void ThrowWithNested() const;
 };
-
-#endif
diff --git a/src/config/Data.hxx b/src/config/Data.hxx
index 3a8fdf8ab..7718d71f1 100644
--- a/src/config/Data.hxx
+++ b/src/config/Data.hxx
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_CONFIG_DATA_HXX
-#define MPD_CONFIG_DATA_HXX
+#pragma once
 
 #include "Option.hxx"
 #include "Param.hxx"
@@ -10,6 +9,7 @@
 
 #include <array>
 #include <chrono>
+#include <concepts>
 #include <forward_list>
 
 class AllocatedPath;
@@ -36,7 +36,7 @@ struct ConfigData {
 		return list.empty() ? nullptr : &list.front();
 	}
 
-	template<typename F>
+	template<std::regular_invocable<const char *> F>
 	auto With(ConfigOption option, F &&f) const {
 		const auto *param = GetParam(option);
 		return param != nullptr
@@ -113,7 +113,7 @@ struct ConfigData {
 	 * Exceptions thrown by the function will be nested in one
 	 * that specifies the location of the block.
 	 */
-	template<typename F>
+	template<std::regular_invocable<const ConfigBlock &> F>
 	void WithEach(ConfigBlockOption option, F &&f) const {
 		for (const auto &block : GetBlockList(option)) {
 			block.SetUsed();
@@ -126,5 +126,3 @@ struct ConfigData {
 		}
 	}
 };
-
-#endif
diff --git a/src/config/Param.hxx b/src/config/Param.hxx
index 8ac98df34..4b69d4be3 100644
--- a/src/config/Param.hxx
+++ b/src/config/Param.hxx
@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright The Music Player Daemon Project
 
-#ifndef MPD_CONFIG_PARAM_HXX
-#define MPD_CONFIG_PARAM_HXX
+#pragma once
 
+#include <concepts>
 #include <string>
 
 class AllocatedPath;
@@ -53,7 +53,7 @@ struct ConfigParam {
 	 * Invoke a function with the configured value; if the
 	 * function throws, call ThrowWithNested().
 	 */
-	template<typename F>
+	template<std::regular_invocable<const char *> F>
 	auto With(F &&f) const {
 		try {
 			return f(value.c_str());
@@ -62,5 +62,3 @@ struct ConfigParam {
 		}
 	}
 };
-
-#endif