| /** | |
| * @file config.hpp | |
| * @brief Application configuration using modern C++23 features. | |
| */ | |
| namespace app::core { | |
| /** | |
| * @brief Runtime configuration loaded from environment or defaults. | |
| */ | |
| struct Config { | |
| std::string app_name{"MyApp"}; | |
| std::string database_url{"sqlite:///app.db"}; | |
| std::string secret_key{"change-me"}; | |
| int port{8080}; | |
| bool debug{false}; | |
| /** | |
| * @brief Load configuration from environment variables. | |
| * @return Config object or error string. | |
| */ | |
| static std::expected<Config, std::string> from_env(); | |
| }; | |
| } // namespace app::core | |