ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
resolver.hpp File Reference
#include <cstdlib>
#include <optional>
#include <string_view>
#include <string>
+ Include dependency graph for resolver.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  arkanjo
 
namespace  arkanjo::config
 

Macros

#define STRINGIFY_IMPL(x)   #x
 
#define STRINGIFY(x)   STRINGIFY_IMPL(x)
 
#define CONFIG_VALUE(name, fallback_lambda)
 

Functions

template<typename F >
auto arkanjo::config::resolve_config_impl (std::string_view name, F &&fallback)
 

Macro Definition Documentation

◆ CONFIG_VALUE

#define CONFIG_VALUE (   name,
  fallback_lambda 
)
Value:
([](auto&& f) { \
if constexpr (std::string_view(#name) != std::string_view(STRINGIFY(name))) { \
return f(std::optional<std::string_view>{STRINGIFY(name)}); \
} else { \
} \
})(fallback_lambda)
auto resolve_config_impl(std::string_view name, F &&fallback)
Definition: resolver.hpp:13
#define STRINGIFY(x)
Definition: resolver.hpp:9

Definition at line 22 of file resolver.hpp.

◆ STRINGIFY

#define STRINGIFY (   x)    STRINGIFY_IMPL(x)

Definition at line 9 of file resolver.hpp.

◆ STRINGIFY_IMPL

#define STRINGIFY_IMPL (   x)    #x

Definition at line 8 of file resolver.hpp.