You copied the Doc URL to your clipboard.


The __value_in_regs qualifier instructs the compiler to return a structure of up to four integer words in integer registers or up to four floats or doubles in floating-point registers rather than using memory.

__value_in_regs is a function qualifier. It affects the type of a function.


__value_in_regs return-type function-name([argument-list]);



is the type of a structure of up to four words in size.


Declaring a function __value_in_regs can be useful when calling functions that return more than one result.


A C++ function cannot return a __value_in_regs structure if the structure requires copy constructing.

If a virtual function declared as __value_in_regs is to be overridden, the overriding function must also be declared as __value_in_regs. If the functions do not match, the compiler generates an error.


Where the structure returned in a function qualified by __value_in_regs is too big, a warning is produced and the __value_in_regs structure is then ignored.


typedef struct int64_struct
    unsigned int lo;
    unsigned int hi;
} int64_struct;
__value_in_regs extern 
    int64_struct mul64(unsigned a, unsigned b);