commit 132fd370190cc8d04468976bf15d42b5b7b2c771 parent 252853998164973ef8278eb43c0b43cd93f4929a Author: Henry Wilson <henry@henryandlizzy.uk> Date: Tue, 23 Dec 2025 16:53:43 +0000 constexpr for standard fds Diffstat:
| M | linux.hpp | | | 14 | +++++++------- |
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/linux.hpp b/linux.hpp @@ -61,16 +61,16 @@ private: struct file { - file() = default; - explicit file(int n) : num{n} {} + constexpr file() = default; + constexpr explicit file(int n) : num{n} {} + constexpr operator bool() const { return num >= 0; } int num = -1; - inline operator bool() const { return num >= 0; } }; -file const AT_FDCWD{-100}; -file const stdin{0}; -file const stdout{1}; -file const stderr{2}; +constexpr file const AT_FDCWD{-100}; +constexpr file const stdin{0}; +constexpr file const stdout{1}; +constexpr file const stderr{2}; enum class errno_t : int16_t {