On Monday 21 October 2002 5:24 pm, Angus Leeming wrote:
> Lars, I'm a bit stuck here. i wonder if you can shed some
> light.

Sorry, I should point out that this dies:
        typedef boost::function2<int, const char *, char *const []>
but this is Ok:
        typedef boost::function2<int, const char *, char *const *>

Any ideas?

Angus

>
> Why won't this compile with g++? Both 3.2 and 2.95 bomb out.
> All is well with cxx.
>
> (I'm just trying things out, so don't worry about what I'm up
> to for now.)
>
> Regards,
> Angus
>
> Index: src/support/forkedcall.C
> ==============================================================
>===== RCS file:
> /usr/local/lyx/cvsroot/lyx-devel/src/support/forkedcall.C,v
> retrieving revision 1.7
> diff -u -p -r1.7 forkedcall.C
> --- src/support/forkedcall.C    25 Sep 2002 10:03:41 -0000    
>  1.7 +++ src/support/forkedcall.C    21 Oct 2002 16:19:31
> -0000 @@ -38,6 +38,7 @@
>  #include "frontends/Timeout.h"
>
>  #include <boost/bind.hpp>
> +#include <boost/function/function2.hpp>
>
>  #include <cerrno>
>  #include <sys/types.h>
> @@ -255,7 +256,12 @@ pid_t Forkedcall::generateChild()
>  #ifndef __EMX__
>         pid_t cpid = ::fork();
>         if (cpid == 0) { // child
> -               execvp(syscmd, argv);
> +               typedef boost::function2<int, const char *,
> char *const []> +                       func_type;
> +
> +               func_type func = execvp;
> +               func(syscmd, argv);
> +               // execvp(syscmd, argv);
>                 // If something goes wrong, we end up here
>                 string args;
>                 int i = 0;
>
> FWIW, the g++ 3.2 error is:
>
> ../../../boost/boost/function/function_template.hpp: In member
> function `R boost::function2<R, T0, T1, Policy, Mixin,
> Allocator>::operator()(T0, T1) const [with R = int, T0 = const
> char*, T1 = char* const[], Policy =
> boost::empty_function_policy, Mixin =
> boost::empty_function_mixin, Allocator =
> std::allocator<boost::function_base>]':
> ../../../src/support/forkedcall.C:263:   instantiated from
> here ../../../boost/boost/function/function_template.hpp:323:
> `a1' has incomplete type
> ../../../boost/boost/function/function_template.hpp:323:
> invalid use of array with unspecified bounds
> ../../../boost/boost/function/function_template.hpp: In static
> member function `static R
> boost::detail::function::function_invoker2<FunctionPtr, R, T0,
> T1>::invoke(boost::detail::function::any_pointer, T0, T1)
> [with FunctionPtr = int (*)(const char*, char* const*) throw
> (), R = int, T0 = const char*, T1 = char* const[]]':
> ../../../boost/boost/function/function_template.hpp:472:  
> instantiated from `void boost::function2<R, T0, T1, Policy,
> Mixin, Allocator>::assign_to(FunctionPtr,
> boost::detail::function::function_ptr_tag) [with FunctionPtr =
> int (*)(const char*, char* const*) throw (), R = int, T0 =
> const char*, T1 = char* const[], Policy =
> boost::empty_function_policy, Mixin =
> boost::empty_function_mixin, Allocator =
> std::allocator<boost::function_base>]'
> ../../../src/support/forkedcall.C:456:   instantiated from
> `void boost::function2<R, T0, T1, Policy, Mixin,
> Allocator>::assign_to(Functor) [with Functor = int (*)(const
> char*, char* const*) throw (), R = int, T0 = const char*, T1 =
> char* const[], Policy = boost::empty_function_policy, Mixin =
> boost::empty_function_mixin, Allocator =
> std::allocator<boost::function_base>]'
> ../../../src/support/forkedcall.C:296:   instantiated from
> `boost::function2<R, T0, T1, Policy, Mixin,
> Allocator>::function2(Functor) [with Functor = int (*)(const
> char*, char* const*) throw (), R = int, T0 = const char*, T1 =
> char* const[], Policy = boost::empty_function_policy, Mixin =
> boost::empty_function_mixin, Allocator =
> std::allocator<boost::function_base>]'
> ../../../src/support/forkedcall.C:262:   instantiated from
> here ../../../boost/boost/function/function_template.hpp:75:
> `a1' has incomplete type
> ../../../boost/boost/function/function_template.hpp:75:
> invalid use of array with unspecified bounds

-- 
Dr Angus Leeming
Dept of Bioengineering
Imperial College
London SW7 2BX
Tel: +44 (0)20 7594 5186
Fax: +44 (0)20 7584 6897

Reply via email to