D
desktop
I have the following code:
#include <stdexcept>
int main(){
int i = 10;
int arr;
int index = 11;
if (index > i) {
throw std:ut_of_range();
}
else {
arr[index] = 33;
}
return 0;
}
but when I compile I get:
no matching function for call to ‘std:ut_of_range:ut_of_range()’
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/stdexcept:99:
note: candidates are: std:ut_of_range:ut_of_range(const std::string&)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/stdexcept:97:
note: std:ut_of_range:ut_of_range(const
std:ut_of_range&)
why can't I use std:ut_of_range() in this manner?
#include <stdexcept>
int main(){
int i = 10;
int arr;
int index = 11;
if (index > i) {
throw std:ut_of_range();
}
else {
arr[index] = 33;
}
return 0;
}
but when I compile I get:
no matching function for call to ‘std:ut_of_range:ut_of_range()’
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/stdexcept:99:
note: candidates are: std:ut_of_range:ut_of_range(const std::string&)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/stdexcept:97:
note: std:ut_of_range:ut_of_range(const
std:ut_of_range&)
why can't I use std:ut_of_range() in this manner?