Boost logo

Boost Users :

Subject: Re: [Boost-users] [function] Boost.Function won't compile under Borland DevStudio 2006
From: Fábio 'Petrucio' Stange (petrucio_at_[hidden])
Date: 2010-04-13 12:31:31


Ok, here's simpler code that demonstrates the same problem:

#include <boost/function.hpp>
#include <iostream.h>

void FooBar(boost::function0<void> callback) {
  callback();
}

void CallbackImpl() {
  cout << "Called back ok\n";
}

int main(int argc, char* argv[])
{
  FooBar(CallbackImpl);
  return 0;
}

I'm stuck with Builder because we already have a major system built with
it (don't look at me, it was coded by Mechanical and Automation
Engeneers, I was hired later to deal with it, so you can guess the size
of my problem). I plan on porting it to Visual Studio, but finding the
time and resources to do that is probably years away. And I probably
won't be here by then.

OvermindDL1 escreveu:
> 2010/4/9 Fábio 'Petrucio' Stange <petrucio_at_[hidden]>:
>
>> I've just recently learned about boost::function when reading Effective C++,
>> and I was thrilled about it.
>>
>> This is the simple code I'm trying to implement:
>>
>> typedef boost::function1<void, boost::shared_ptr<VarSpeedObject> >
>> ObjectDoneCallback;
>> void SomeFunction(ObjectDoneCallback callback, ...) {
>> // Some code
>> callback(...);
>> }
>>
>> When trying to compile it under C++ Builder 2006 (I have no other choice but
>> to use this in the current project), I get the following error:
>>
>> [C++ Error] function_template.hpp(904): E2131 Objects of type
>> 'detail::function::basic_vtable1<void,shared_ptr<VarSpeedObject> >' cannot
>> be initialized with { }
>>
>> On this line in function_template.hpp:
>> static vtable_type stored_vtable =
>> { { &manager_type::manage }, &invoker_type::invoke };
>>
>> Can I circumvent this somehow to make it compile under my environment?
>>
>
> Two things.
>
> First, it is best to give is a complete, but simplified example that
> demonstrates the problem.
>
> Second, the Borland builder has lots of issue, and that is putting it
> mildly. Why are you stuck with it?
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
> ------------------------------------------------------------------------
>
>
> Nenhum vîrus encontrado nessa mensagem recebida.
> Verificado por AVG - www.avgbrasil.com.br
> Versäo: 8.5.437 / Banco de dados de vîrus: 271.1.1/2808 - Data de Lančamento: 04/13/10 06:32:00
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net