-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
performanceThis can be done fasterThis can be done faster
Description
See the new attribute [[likely]]
compare (see this link)
if (n <= MaximumFactorialNumber)
{
return Internal::_factorials[n];
}
else
{
throw std::out_of_range(std::string("Only numbers from 0 to ").append(std::to_string(MaximumFactorialNumber)).append("are supported by unsigned integer with 64 bits length."));
}And
if (n <= MaximumFactorialNumber) [[likely]]
{
return Internal::_factorials[n];
}
else [[unlikely]]
{
throw std::out_of_range(std::string("Only numbers from 0 to ").append(std::to_string(MaximumFactorialNumber)).append("are supported by unsigned integer with 64 bits length."));
}Metadata
Metadata
Assignees
Labels
performanceThis can be done fasterThis can be done faster