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
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
cxx: [g++-4.8, g++-10, clang++-9]
|
cxx: [g++-4.9, g++-10, clang++-9]
|
||||||
build_type: [Debug, Release]
|
build_type: [Debug, Release]
|
||||||
std: [11]
|
std: [11]
|
||||||
include:
|
include:
|
||||||
- cxx: g++-4.8
|
- cxx: g++-4.9
|
||||||
install: sudo apt install g++-4.8
|
install: sudo apt install g++-4.9
|
||||||
- cxx: g++-8
|
- cxx: g++-8
|
||||||
build_type: Debug
|
build_type: Debug
|
||||||
std: 14
|
std: 14
|
||||||
@ -64,13 +64,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Add repositories for older GCC
|
- name: Add repositories for older GCC
|
||||||
run: |
|
run: |
|
||||||
# Below two repos provide GCC 4.8, 5.5 and 6.4
|
# Below repo provides GCC 4.9.
|
||||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic main'
|
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial main'
|
||||||
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe'
|
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ xenial universe'
|
||||||
# Below two repos additionally update GCC 6 to 6.5
|
if: ${{ matrix.cxx == 'g++-4.9' }}
|
||||||
# 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' }}
|
|
||||||
|
|
||||||
- name: Add repositories for newer GCC
|
- name: Add repositories for newer GCC
|
||||||
run: |
|
run: |
|
||||||
|
@ -3012,6 +3012,16 @@ template <typename Char = char> struct runtime_format_string {
|
|||||||
basic_string_view<Char> str;
|
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.
|
/// A compile-time format string.
|
||||||
template <typename Char, typename... Args> class basic_format_string {
|
template <typename Char, typename... Args> class basic_format_string {
|
||||||
private:
|
private:
|
||||||
@ -3053,23 +3063,8 @@ template <typename Char, typename... Args> class basic_format_string {
|
|||||||
auto get() const -> basic_string_view<Char> { return str_; }
|
auto get() const -> basic_string_view<Char> { return str_; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
|
template <typename... T>
|
||||||
// Workaround broken conversion on older gcc.
|
using format_string = basic_format_string<char, type_identity_t<T>...>;
|
||||||
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
|
|
||||||
|
|
||||||
/// Formats a string and writes the output to `out`.
|
/// Formats a string and writes the output to `out`.
|
||||||
template <typename OutputIt,
|
template <typename OutputIt,
|
||||||
|
Loading…
Reference in New Issue
Block a user