Changeset b1cd380c in mainline
- Timestamp:
- 2018-07-05T21:41:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac47ba95
- Parents:
- 75848a8
- git-author:
- Jaroslav Jindrak <dzejrou@…> (2017-10-13 17:17:24)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:17)
- Location:
- uspace/lib/cpp/include
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/exception
r75848a8 rb1cd380c 27 27 */ 28 28 29 #ifndef LIBCPP_EXCEPTION 30 #define LIBCPP_EXCEPTION 31 32 namespace std 33 { 34 35 class exception 36 { 37 public: 38 exception() = default; 39 exception(const exception&) = default; 40 exception& operator=(const exception&) noexcept; 41 virtual const char* what() const; 42 virtual ~exception() = default; 43 }; 44 45 } 46 47 #endif 29 #include <impl/exception.hpp> -
uspace/lib/cpp/include/type_traits
r75848a8 rb1cd380c 27 27 */ 28 28 29 #include <cstdlib> 30 31 namespace std 32 { 33 /** 34 * 20.10.3, helper class: 35 */ 36 37 template<class T, T v> 38 struct integral_constant 39 { 40 static constexpr T value = v; 41 42 using value_type = T; 43 using type = integral_constant<T, v>; 44 45 constexpr operator value_type() const noexcept 46 { 47 return value; 48 } 49 50 constexpr value_type operator()() const noexcept 51 { 52 return value; 53 } 54 } 55 56 using true_type = integral_constant<bool, true>; 57 using false_type = integral_constant<bool, false>; 58 59 /** 60 * 20.10.4.1, primary type categories: 61 */ 62 63 template<class> 64 struct remove_cv; 65 66 template<class T> 67 using remove_cv_t = typename remove_cv<T>::type; 68 69 template<class T> 70 struct is_void: aux::is_void<remove_cv_t<T>>; 71 72 template<class T> 73 struct is_null_pointer: aux::is_null_pointer<remove_cv_t<T>>; 74 75 template<class T> 76 struct is_integral: aux::is_integral<remove_cv_t<T>>; 77 78 template<class T> 79 struct is_floating_point: aux::is_floating_point<remove_cv_t<T>>; 80 81 template<class> 82 struct is_array: false_type; 83 84 template<class T> 85 struct is_array<T[]>: true_type; 86 87 template<class T> 88 struct is_pointer: aux::is_pointer<remove_cv_t<T>>; 89 90 template<class T> 91 struct is_lvalue_reference; 92 93 template<class T> 94 struct is_rvalue_reference; 95 96 template<class T> 97 struct is_member_object_pointer; 98 99 template<class T> 100 struct is_member_function_pointer; 101 102 template<class T> 103 struct is_enum; 104 105 template<class T> 106 struct is_union; 107 108 template<class T> 109 struct is_class; 110 111 template<class T> 112 struct is_function; 113 114 /** 115 * 20.10.4.2, composite type categories: 116 */ 117 118 template<class T> 119 struct is_reference; 120 121 template<class T> 122 struct is_arithmetic; 123 124 template<class T> 125 struct is_fundamental; 126 127 template<class T> 128 struct is_object; 129 130 template<class T> 131 struct is_scalar; 132 133 template<class T> 134 struct is_compound; 135 136 template<class T> 137 struct is_member_pointer; 138 139 /** 140 * 20.10.4.3, type properties: 141 */ 142 143 template<class T> 144 struct is_const; 145 146 template<class T> 147 struct is_volatile; 148 149 template<class T> 150 struct is_trivial; 151 152 template<class T> 153 struct is_trivially_copyable; 154 155 template<class T> 156 struct is_standard_layout; 157 158 template<class T> 159 struct is_pod; 160 161 template<class T> 162 struct is_literal_type; 163 164 template<class T> 165 struct is_empty; 166 167 template<class T> 168 struct is_polymorphic; 169 170 template<class T> 171 struct is_abstract; 172 173 template<class T> 174 struct is_final; 175 176 template<class T> 177 struct is_signed; 178 179 template<class T> 180 struct is_unsidned; 181 182 template<class T, class... Args> 183 struct is_constructible; 184 185 template<class T> 186 struct is_default_constructible; 187 188 template<class T> 189 struct is_copy_constructible; 190 191 template<class T> 192 struct is_move_constructible; 193 194 template<class T, class U> 195 struct is_assignable; 196 197 template<class T> 198 struct is_copy_assignable; 199 200 template<class T> 201 struct is_move_assignable; 202 203 template<class T> 204 struct is_destructible; 205 206 template<class T, class... Args> 207 struct is_trivially_constructible; 208 209 template<class T> 210 struct is_trivially_default_constructible; 211 212 template<class T> 213 struct is_trivially_copy_constructible; 214 215 template<class T> 216 struct is_trivially_move_constructible; 217 218 template<class T, class U> 219 struct is_trivially_assignable; 220 221 template<class T> 222 struct is_trivially_copy_assignable; 223 224 template<class T> 225 struct is_trivially_move_assignable; 226 227 template<class T> 228 struct is_trivially_destructible; 229 230 template<class T, class... Args> 231 struct is_nothrow_constructible; 232 233 template<class T> 234 struct is_nothrow_default_constructible; 235 236 template<class T> 237 struct is_nothrow_copy_constructible; 238 239 template<class T> 240 struct is_nothrow_move_constructible; 241 242 template<class T, class U> 243 struct is_nothrow_assignable; 244 245 template<class T> 246 struct is_nothrow_copy_assignable; 247 248 template<class T> 249 struct is_nothrow_move_assignable; 250 251 template<class T> 252 struct is_nothrow_destructible; 253 254 template<class T> 255 struct has_virtual_destructor; 256 257 /** 258 * 20.10.5, type property queries: 259 */ 260 261 template<class T> 262 struct alignment_of; 263 264 template<class T> 265 struct rank; 266 267 template<class T, unsigned I = 0> 268 struct extent; 269 270 /** 271 * 20.10.6, type relations: 272 */ 273 274 template<class T, class U> 275 struct is_same: false_type; 276 277 template<class T> 278 struct is_same<T, T>: true_type; 279 280 template<class Base, class Derived> 281 struct is_base_of; 282 283 template<class From, class To> 284 struct is_convertible; 285 286 /** 287 * 20.10.7.1, const-volatile modifications: 288 */ 289 290 template<class T> 291 struct remove_const; 292 293 template<class T> 294 struct remove_volatile; 295 296 template<class T> 297 struct remove_cv; 298 299 template<class T> 300 struct add_const; 301 302 template<class T> 303 struct add_volatile; 304 305 template<class T> 306 struct add_cv; 307 308 template<class T> 309 using remove_const_t = typename remove_const<T>::type; 310 311 template<class T> 312 using remove_volatile_t = typename remove_volatile<T>::type; 313 314 template<class T> 315 using remove_cv_t = typename remove_cv<T>::type; 316 317 template<class T> 318 using add_const_t = typename add_const<T>::type; 319 320 template<class T> 321 using add_volatile_t = typename add_volatile<T>::type; 322 323 template<class T> 324 using add_cv_t = typename add_cv<T>::type; 325 326 /** 327 * 20.10.7.2, reference modifications: 328 */ 329 330 template<class T> 331 struct remove_reference; 332 333 template<class T> 334 struct add_lvalue_reference; 335 336 template<class T> 337 struct add_rvalue_reference; 338 339 template<class T> 340 using remove_reference_t = typename remove_reference<T>::type; 341 342 template<class T> 343 using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; 344 345 template<class T> 346 using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; 347 348 /** 349 * 20.10.7.3, sign modifications: 350 */ 351 352 template<class T> 353 struct make_signed; 354 355 template<class T> 356 struct make_unsigned; 357 358 template<class T> 359 using make_signed_t = typename make_signed<T>::type; 360 361 template<class T> 362 using make_unsigned_t = typename make_signed<T>::type; 363 364 /** 365 * 20.10.7.4, array modifications: 366 */ 367 368 template<class T> 369 struct remove_extent; 370 371 template<class T> 372 struct remove_all_extents; 373 374 template<class T> 375 using remove_extent_t = typename remove_extent<T>::type; 376 377 template<class T> 378 using remove_all_extents_t = typename remove_all_extents<T>::type; 379 380 /** 381 * 20.10.7.5, pointer modifications: 382 */ 383 384 template<class T> 385 struct remove_pointer; 386 387 template<class T> 388 struct add_pointer; 389 390 template<class T> 391 using remove_pointer_t = typename remove_pointer<T>::type; 392 393 template<class T> 394 using add_pointer_t = typename add_pointer<T>::type; 395 396 /** 397 * 20.10.7.6, other transformations: 398 */ 399 400 // TODO: consult standard on the default value of align 401 template<std::size_t Len, std::size_t Align = 0> 402 struct aligned_storage; 403 404 template<std::size_t Len, class... Types> 405 struct aligned_union; 406 407 template<class T> 408 struct decay; 409 410 template<bool, class T = void> 411 struct enable_if; 412 413 template<bool, class T, class F> 414 struct conditional; 415 416 template<class... T> 417 struct common_type; 418 419 template<class... T> 420 struct underlying_type; 421 422 template<class> 423 class result_of; // not defined 424 425 template<class F, class... ArgTypes> 426 class result_of<F(ArgTypes...)>; 427 428 template<std::size_t Len, std::size_t Align = 0> 429 using aligned_storage_t = typename aligned_storage<Len, Align>::type; 430 431 template<std::size_t Len, class... Types> 432 using aligned_union_t = typename aligned_union<Len, Types...>::type; 433 434 template<class T> 435 using decay_t = typename decay<T>::type; 436 437 template<bool b, class T = void> 438 using enable_if_t = typename enable_if<b, T>::type; 439 440 template<bool b, class T, class F> 441 using conditional_t = typename conditional<b, T, F>::type; 442 443 template<class... T> 444 using common_type_t = typename common_type<T...>::type; 445 446 template<class T> 447 using underlying_type_t = typename underlying_type<T>::type; 448 449 template<class T> 450 using result_of_t = typename result_of<T>::type; 451 452 template<class T> 453 using void_t = void; 454 } 29 #include <impl/type_traits.hpp> -
uspace/lib/cpp/include/typeinfo
r75848a8 rb1cd380c 27 27 */ 28 28 29 #include <cstdlib> 30 31 namespace std 32 { 33 34 class type_info 35 { 36 public: 37 virtual ~type_info(); 38 39 bool operator==(const type_info&) const noexcept; 40 bool operator!=(const type_info&) const noexcept; 41 42 bool before(const type_info&) const noexcept; 43 44 size_t hash_code() const noexcept; 45 46 const char* name() const noexcept; 47 48 type_info(const type_info&) = delete; 49 type_info& operator=(const type_info&) = delete; 50 51 private: 52 const char* __name; 53 }; 54 55 // TODO: class bad_cast, bad_typeid 56 } 29 #include <impl/typeinfo.hpp>
Note:
See TracChangeset
for help on using the changeset viewer.