mr1yh1
27/05/2005, 03:51
bu kod neden çalışmıyor ?..
bfoo, struct binary_function tipinde nesne..
less<int> , aynı struct dan türüyor..
less<int>() , less<int> tipinde bir nesne..
atama kabul ediliyor..
fakat fonksiyonu çağırmak mümkün olmuyor..
#include <iostream>
#include <functional>
using namespace std;
int main()
{
binary_function<int,int,bool> *bfoo;
bfoo = &less<int>() ;//less binary function dan türediğine göre..
if ( (*bfoo)(2,3) ) cout << "2<3";//derleme hatası ..
}
error: no match for call to `(std::binary_function<int, int,
bool>) (int, int)'
bfoo, struct binary_function tipinde nesne..
less<int> , aynı struct dan türüyor..
less<int>() , less<int> tipinde bir nesne..
atama kabul ediliyor..
fakat fonksiyonu çağırmak mümkün olmuyor..
#include <iostream>
#include <functional>
using namespace std;
int main()
{
binary_function<int,int,bool> *bfoo;
bfoo = &less<int>() ;//less binary function dan türediğine göre..
if ( (*bfoo)(2,3) ) cout << "2<3";//derleme hatası ..
}
error: no match for call to `(std::binary_function<int, int,
bool>) (int, int)'