Skip to content
Snippets Groups Projects
Commit a9a4cad9 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Fix compilation with fmtlib < 8

parent fd500e24
No related branches found
No related tags found
1 merge request!1455C++20 fixes
......@@ -21,6 +21,15 @@
#include <map>
#include <string_view>
#if FMT_VERSION < 80000
namespace fmt {
template <typename T>
const T& runtime( const T& v ) {
return v;
}
} // namespace fmt
#endif
namespace {
/**
......
......@@ -79,6 +79,7 @@ gaudi_add_library(GaudiKernel
src/Lib/GaudiMain.cpp
src/Lib/Guards.cpp
src/Lib/HistoDef.cpp
src/Lib/HistogramArray.cpp
src/Lib/HistoryObj.cpp
src/Lib/IChronoStatSvc.cpp
src/Lib/IConversionSvc.cpp
......
......@@ -11,9 +11,6 @@
#pragma once
#include <Gaudi/Accumulators/Histogram.h>
#include <fmt/format.h>
#include <utility>
namespace Gaudi::Accumulators {
......@@ -27,7 +24,7 @@ namespace Gaudi::Accumulators {
struct FormatHistDefault {
std::string_view text;
FormatHistDefault( std::string_view t ) : text{ t } {}
auto operator()( size_t n ) { return fmt::format( fmt::runtime( text ), n ); }
std::string operator()( size_t n );
};
/**
......
/***********************************************************************************\
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
* *
* This software is distributed under the terms of the Apache version 2 licence, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this licence, CERN does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\***********************************************************************************/
#include <Gaudi/Accumulators/HistogramArray.h>
#include <fmt/format.h>
#if FMT_VERSION < 80000
namespace fmt {
template <typename T>
const T& runtime( const T& v ) {
return v;
}
} // namespace fmt
#endif
std::string Gaudi::Accumulators::details::FormatHistDefault::operator()( size_t n ) {
return fmt::format( fmt::runtime( text ), n );
}
......@@ -69,6 +69,15 @@
#include <type_traits>
#include <vector>
#if FMT_VERSION < 80000
namespace fmt {
template <typename T>
const T& runtime( const T& v ) {
return v;
}
} // namespace fmt
#endif
namespace po = boost::program_options;
namespace fs = boost::filesystem;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment