views:

115

answers:

1

it works when :

list<ItemFixed> XYZ::List()
{
        list<Item> items = _Browser->GetMusic();
        list<ItemFixed> retItems = _Converter->Convert (items);
        return retItems;
}

but not :

list<ItemFixed> XYZ::List()
{
        return _Converter->Convert (_Browser->GetMusic());
}

Any suggestions? thanks

+3  A: 

Are you passing the list<Item> as non-const reference to Convert function? In that case it will not compile as you can not pass temporary object by non-const reference in C++.

Naveen
fritzone