Skip to content

Commit

Permalink
Add integral_constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Aug 4, 2024
1 parent 78db9ea commit 6ec2f9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 👷 Cute Engineering C++ Standard Library

The ISO C++ Standard Library, ISO/IEC 14882

## Overview

The Cute Engineering C++ Standard Library is a minimalist implementation of the ISO C++ Standard Library. It provides only the essential features needed to fully utilize most core C++ language functionalities.
12 changes: 12 additions & 0 deletions src/ce-stdcpp/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,16 @@ template <typename T> struct remove_cvref {

template <typename T> using remove_cvref_t = typename remove_cvref<T>::type;

// MARK: Integral Constant -----------------------------------------------------

template <class T, T v> struct integral_constant {
static constexpr T value = v;
using value_type = T;
using type = integral_constant;

constexpr operator value_type() const noexcept { return value; }

constexpr value_type operator()() const noexcept { return value; }
};

} // namespace std

0 comments on commit 6ec2f9f

Please sign in to comment.