Skip to content

docs(feature-flags): document feature flags framework#345

Merged
kcenon merged 1 commit into
mainfrom
docs/issue-327-document-feature-flags-framework
Feb 8, 2026
Merged

docs(feature-flags): document feature flags framework#345
kcenon merged 1 commit into
mainfrom
docs/issue-327-document-feature-flags-framework

Conversation

@kcenon

@kcenon kcenon commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Closes #327

Summary

Add comprehensive documentation for the feature flags framework (docs/FEATURE_FLAGS_GUIDE.md) covering all 4 header files:

  • feature_flags_core.h — Preprocessor helpers, compiler detection, platform detection, C++ standard detection
  • feature_detection.h — C++20/23 standard library feature detection (15+ features)
  • feature_flags.h — Main entry point with legacy aliases and static assertions
  • feature_system_deps.h — Cross-system integration flags for 7 ecosystem systems

Documentation Contents

1. Feature Flags System Overview

  • Compile-time vs runtime feature flags distinction
  • Flag lifecycle (define → activate → check → deprecate → remove)
  • Architecture diagram showing integration with ecosystem

2. Core Definitions (feature_flags_core.h)

  • Preprocessor helpers: KCENON_HAS_INCLUDE, KCENON_HAS_CPP_ATTRIBUTE, KCENON_HAS_FEATURE, KCENON_HAS_BUILTIN
  • Compiler detection: MSVC, Clang, GCC with version numbers
  • C++ standard detection: C++17, C++20, C++23
  • Platform detection: Windows, Linux, macOS, Unix
  • Legacy aliases: Backward compatibility support

3. Feature Detection (feature_detection.h)

  • C++20 features: source_location, jthread/stop_token, format, span, ranges, concepts, coroutines, three-way comparison
  • C++23 features: expected, stacktrace, optional monadic operations
  • Constexpr enhancements: constexpr vector, constexpr string
  • Platform-specific features: SIMD detection (AVX2, NEON)

4. Runtime Feature Flags (feature_flags.h)

  • Flag registration during initialization
  • Dynamic evaluation throughout application
  • Flag change notifications via hot-reload
  • Thread-safe access patterns

5. System Dependencies (feature_system_deps.h)

  • 7 system integration flags: thread_system, logger_system, monitoring_system, container_system, network_system, database_system, messaging_system
  • Dependency resolution at build time
  • Optional vs required dependencies
  • Feature compatibility matrix

6. Usage Examples

  • Compile-time examples: Platform-specific code, C++ feature detection, compiler optimizations
  • Runtime examples: Feature toggles, gradual rollouts
  • Cross-system integration: Logger + Thread, Database + Monitoring

7. CMake Integration

  • Build configuration with feature flags
  • System integration options

8. Migration Guide

  • Migrating from legacy macros to KCENON_* macros
  • Gradual migration strategy for large codebases
  • Deprecation timeline

9. Troubleshooting

  • Feature not detected
  • System integration not working
  • Legacy macro conflicts
  • C++17 static assertion failure

Test Plan

  • Documentation follows existing style (CONFIG_GUIDE.md, INTEGRATION_GUIDE.md)
  • All 4 feature flag headers documented
  • 15+ C++20/23 features covered
  • 7 system integration flags documented
  • Compile-time and runtime examples provided
  • CMake integration guide included
  • Migration guide from legacy macros
  • Troubleshooting section added

Related Files

  • include/kcenon/common/config/feature_flags_core.h
  • include/kcenon/common/config/feature_detection.h
  • include/kcenon/common/config/feature_flags.h
  • include/kcenon/common/config/feature_system_deps.h

Add comprehensive documentation for the feature flags framework including:
- Feature detection system architecture (compile-time vs runtime)
- Core definitions with preprocessor helpers and compiler/platform detection
- C++20/23 standard library feature detection (15+ features)
- Runtime feature flags integration with configuration system
- Cross-system dependency management (7 systems)
- Usage examples for compile-time and runtime flags
- CMake integration guide
- Migration guide from legacy macros
- Troubleshooting guide

Closes #327
@kcenon kcenon merged commit 921c887 into main Feb 8, 2026
24 checks passed
@kcenon kcenon deleted the docs/issue-327-document-feature-flags-framework branch February 8, 2026 09:52
kcenon added a commit that referenced this pull request Apr 13, 2026
Add comprehensive documentation for the feature flags framework including:
- Feature detection system architecture (compile-time vs runtime)
- Core definitions with preprocessor helpers and compiler/platform detection
- C++20/23 standard library feature detection (15+ features)
- Runtime feature flags integration with configuration system
- Cross-system dependency management (7 systems)
- Usage examples for compile-time and runtime flags
- CMake integration guide
- Migration guide from legacy macros
- Troubleshooting guide

Closes #327
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.

[Task] docs: Document feature flags framework

1 participant