Learn To Build your own C++ Utility Library Files Part-1 utilities.h


The utilities.h header file contains multiple using type-alias like
uint for unsigned int, real for long doubleto shorten typing.

And it also contains functions for random number generationlike,
rand_longto get a random value of type long long,
orrand_initto seed the random value generator based on the current timestamp, and shuffle_collection to shuffle any collection, that overloads the array subscript ([ ]) operator, etc.

And some structs that delegate to operators, and some mathematical functions like abs to get the absolute value of an integral or floating-point type or floor to convert a floating-point type to an integral type by removing the digits after the floating-point.

Along withtype-traits like
rem_ref, rem_const, etc.
which remove
references, constqualifiers, etc from types, and other type traits like
is_ref, is_lval_ref, etc
to check for certain attributes on types,
or the select_to select a type if a condition evaluates to true.

Nguồn: https://inkstitch.net

Xem thêm bài viết khác: https://inkstitch.net/cong-nghe

Article Tags:
Article Categories:
Công Nghệ

Leave a Reply

Your email address will not be published. Required fields are marked *