Skip to content

Instantly share code, notes, and snippets.

View DavidAce's full-sized avatar
🔬

David Aceituno Chávez DavidAce

🔬
  • KTH - Royal Institute of Technology
  • Stockholm
View GitHub Profile
@DavidAce
DavidAce / fmt-complex.h
Last active May 10, 2023 11:26
fmt formatter for std::complex<T> type
template<typename T, typename Char>
struct fmt::formatter<std::complex<T>, Char> : fmt::formatter<T, Char> {
typedef fmt::formatter<T, Char> base;
enum style { expr, pair } style_ = expr;
fmt::detail::dynamic_format_specs<Char> specs_;
FMT_CONSTEXPR auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) {
using handler_type = fmt::detail::dynamic_specs_handler<format_parse_context>;
auto type = fmt::detail::type_constant<T, Char>::value;
fmt::detail::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
auto it = ctx.begin();
@DavidAce
DavidAce / cmake-conan-integration-dependency-provider.md
Last active March 30, 2023 07:27
cmake-conan dependency provider (for conan v1)

CMake-Conan integration for conan v1.

Inspired by the dependency-provider mechanism for conan v2

This uses the new CMake dependency provider feature to let conan resolve dependencies when you call find_packkage(<lib>) from CMakeLists.txt in your own project.

Requires

  • conan>=1.59
  • cmake>=3.24