I\'ve seen different code snippets using these types, but I haven\'t seen if they are defined in some
These types aren't a part of standard C++. They might either be defined in some third-party library, or you're looking at some other dialect or language.
GPU code (Shader languages such as GLSL, Cg or HLSL, or GPGPU stuff like CUDA or OpenCL) typically defines types like these though, as names for the corresponding SIMD datatypes.
They are used in CUDA (and openCL?) where you have specific sized floats and memory usage and alignment is a big deal.
AFAIK there is no standard header file that defines these types.
According to your description int2
means a pair of two int
s which can be represented in C++ as std::pair<int, int>
.
I stay with the POSIX types defined in <stdint.h>. It seems like everyone defines their own names for things and I've had a project where the names collide. It's become a new paradigm for me to NOT define my own "pet" names for types.
These types are not standard and I've never seen them. Are you sure they weren't used as (terrible choices of) identifiers instead of types?
Some non-standard types that are quite likely available anyway are int32_t
, uint64_t
, etc. (These are specified by C99, so most modern C++ compilers also let you use them in C++.)