Global namespace
The declarations that every CShift program sees without a using: the interfaces the language itself relies on
(using with IDisposable, sorting with IComparable, equality and hashing for collections) and
sqrt.
The types, functions and namespaces that the compiler provides itself: string, the numbers (int32, double,
…), bool, char, arrays (Array), slices (Slice, ReadOnlySlice, StringSlice), Fixed, Optional,
Error, Console, Environment, Memory, Thread, SharedPtr, Enum, Action and Func. They need no
using.
| Type | Description |
|---|---|
IDisposable |
A resource that has to be released: `using (var f = …) { … |
IComparable<T> |
Values that have an order: List<T>.Sort and the comparison of keys use it. |
IEquatable<T> |
Equality for generic containers (List<T>.IndexOf, List<T>.Contains, the keys of a Dictionary). |
IHashable |
Hash codes for the keys of a Dictionary and the values of a HashSet. |
Functions
Section titled “Functions”| Name | Description |
|---|---|
sqrt |
The square root of x (the C library’s sqrt). |
extern "C" double sqrt(double x)The square root of x (the C library’s sqrt).
Returns NaN for a negative x.
float sqrt(float x)The square root of x as a float (the C library’s sqrtf).
Returns NaN for a negative x.