Search code examples
c++windowsvisual-studiodeclaration

return type before or after __declspec?


should I use

bool __declspec(dllexport) function()
{ 
    return true;
} 

or

__declspec(dllexport) bool function()
{
    return true;
}

what is the difference between these two? Will this affect how the functions are executed or what they return when called from an application? (this code is ment for a DLL).


Solution

  • If both are accepted by the compiler, it's hard to see how they can be anything other than exactly equivalent.