feat(concepts): add C++20 concepts for logger, monitoring, and transport interfaces#247
Merged
Conversation
…ort interfaces Add new C++20 concept definitions for compile-time type constraints: - concepts/logger.h: LoggerLike, BasicLogger, LevelAwareLogger, FlushableLogger, StructuredLogger, LoggerProviderLike, LoggerRegistryLike - concepts/monitoring.h: MetricCollectorLike, CounterMetric, GaugeMetric, HistogramMetric, TimingMetric, MetricCollectorProviderLike - concepts/transport.h: HttpClientLike, UdpClientLike, HttpSender, HttpAvailabilityChecker, UdpConnectable, UdpSender, UdpConnectionStatus, TransportClient, provider concepts Updates: - Fix VoidResult forward declaration conflict in callable.h by including fwd.h - Update concepts.h umbrella header with new concept categories and documentation - Add comprehensive unit tests with static_assert compile-time validation Benefits: - Clearer error messages for template constraint violations - Self-documenting interface requirements - Zero runtime overhead (compile-time only) - Better IDE support for auto-completion Resolves: #244
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…ort interfaces (#247) Add new C++20 concept definitions for compile-time type constraints: - concepts/logger.h: LoggerLike, BasicLogger, LevelAwareLogger, FlushableLogger, StructuredLogger, LoggerProviderLike, LoggerRegistryLike - concepts/monitoring.h: MetricCollectorLike, CounterMetric, GaugeMetric, HistogramMetric, TimingMetric, MetricCollectorProviderLike - concepts/transport.h: HttpClientLike, UdpClientLike, HttpSender, HttpAvailabilityChecker, UdpConnectable, UdpSender, UdpConnectionStatus, TransportClient, provider concepts Updates: - Fix VoidResult forward declaration conflict in callable.h by including fwd.h - Update concepts.h umbrella header with new concept categories and documentation - Add comprehensive unit tests with static_assert compile-time validation Benefits: - Clearer error messages for template constraint violations - Self-documenting interface requirements - Zero runtime overhead (compile-time only) - Better IDE support for auto-completion Resolves: #244
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
New Concept Files
concepts/logger.h
BasicLogger: Types with basic log functionalityLevelAwareLogger: Types supporting log level filteringFlushableLogger: Types supporting flush operationStructuredLogger: Types supporting structured log entriesLoggerLike: Complete ILogger interface constraintLoggerProviderLike,LoggerRegistryLike: DI support conceptsconcepts/monitoring.h
CounterMetric: Types supporting increment operationsGaugeMetric: Types supporting gauge operationsHistogramMetric: Types supporting histogram observationsTimingMetric: Types supporting timing measurementsMetricCollectorLike: Complete IMetricCollector constraintMetricCollectorProviderLike: DI support conceptconcepts/transport.h
HttpSender,HttpAvailabilityChecker: HTTP client conceptsHttpClientLike: Complete IHttpClient interface constraintUdpConnectable,UdpSender,UdpConnectionStatus: UDP client conceptsUdpClientLike: Complete IUdpClient interface constraintTransportClient: Generic transport client constraint (HTTP or UDP)Bug Fixes
callable.hby includingfwd.hinsteadDocumentation
concepts.humbrella header with new concept categoriesBenefits
Test plan
Resolves: #244