mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 11:14:41 +00:00
Remove old gcc hack
This commit is contained in:
parent
8eda3c8e90
commit
db496b47c1
17
.github/workflows/linux.yml
vendored
17
.github/workflows/linux.yml
vendored
@ -10,12 +10,12 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
cxx: [g++-4.8, g++-10, clang++-9]
|
||||
cxx: [g++-4.9, g++-10, clang++-9]
|
||||
build_type: [Debug, Release]
|
||||
std: [11]
|
||||
include:
|
||||
- cxx: g++-4.8
|
||||
install: sudo apt install g++-4.8
|
||||
- cxx: g++-4.9
|
||||
install: sudo apt install g++-4.9
|
||||
- cxx: g++-8
|
||||
build_type: Debug
|
||||
std: 14
|
||||
@ -64,13 +64,10 @@ jobs:
|
||||
|
||||
- name: Add repositories for older GCC
|
||||
run: |
|
||||
# Below two repos provide GCC 4.8, 5.5 and 6.4
|
||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic main'
|
||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe'
|
||||
# Below two repos additionally update GCC 6 to 6.5
|
||||
# sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates main'
|
||||
# sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates universe'
|
||||
if: ${{ matrix.cxx == 'g++-4.8' }}
|
||||
# Below repo provides GCC 4.9.
|
||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial main'
|
||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial universe'
|
||||
if: ${{ matrix.cxx == 'g++-4.9' }}
|
||||
|
||||
- name: Add repositories for newer GCC
|
||||
run: |
|
||||
|
@ -3012,6 +3012,16 @@ template <typename Char = char> struct runtime_format_string {
|
||||
basic_string_view<Char> str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a runtime format string.
|
||||
*
|
||||
* **Example**:
|
||||
*
|
||||
* // Check format string at runtime instead of compile-time.
|
||||
* fmt::print(fmt::runtime("{:d}"), "I am not a number");
|
||||
*/
|
||||
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }
|
||||
|
||||
/// A compile-time format string.
|
||||
template <typename Char, typename... Args> class basic_format_string {
|
||||
private:
|
||||
@ -3053,23 +3063,8 @@ template <typename Char, typename... Args> class basic_format_string {
|
||||
auto get() const -> basic_string_view<Char> { return str_; }
|
||||
};
|
||||
|
||||
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
|
||||
// Workaround broken conversion on older gcc.
|
||||
template <typename...> using format_string = string_view;
|
||||
inline auto runtime(string_view s) -> string_view { return s; }
|
||||
#else
|
||||
template <typename... Args>
|
||||
using format_string = basic_format_string<char, type_identity_t<Args>...>;
|
||||
/**
|
||||
* Creates a runtime format string.
|
||||
*
|
||||
* **Example**:
|
||||
*
|
||||
* // Check format string at runtime instead of compile-time.
|
||||
* fmt::print(fmt::runtime("{:d}"), "I am not a number");
|
||||
*/
|
||||
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }
|
||||
#endif
|
||||
template <typename... T>
|
||||
using format_string = basic_format_string<char, type_identity_t<T>...>;
|
||||
|
||||
/// Formats a string and writes the output to `out`.
|
||||
template <typename OutputIt,
|
||||
|
Loading…
Reference in New Issue
Block a user