On Thu, 9 Oct, 2014 at 4:14 PM, Anders Logg <[email protected]> wrote:
On Thu, Oct 09, 2014 at 12:04:19PM +0100, Garth N. Wells wrote:


 On Fri, 3 Oct, 2014 at 4:25 PM, Martin Sandve Alnæs
 <[email protected]> wrote:
 >Have you considered the C++ way with io streams?
 >

 That would be my preferred approach, but it would break the current
 interface.
 >Or it might be solvable using C++11 variadic templates?
 >

 Maybe, but I'd prefer a simpler solution if possible.

 >I'm not sure I understand the problem though.
 >
 In a nutshell, the use of ellipses in functions like dolfin_error
 mean that we cannot overload the function, e.g. it doesn't appear
 possible to do:

  void dolfin_error(std::string location,
                    std::string task,
                    std::string reason, ...);

  void dolfin_error(MPI_Comm mpi_comm,
                    std::string location,
                    std::string task,
                    std::string reason, ...);


Can't we just rename that second version that takes a communicator?

Suggestions:

  _dolfin_error
  dolfin_error_mpi
  dolfin_error_comm

We can use different names for versions that take a communicator, but it's not pretty or very cpp-like.

Garth



--
Anders


 Garth
 >Martin
 >
>3. okt. 2014 16:00 skrev "Garth N. Wells" <[email protected]> følgende:
 >>We have some very C-like (and not C++ like) code in the DOLFIN
 >>logging that uses ellipses to take a variable number of
 >>arguments, e.g in dolfin/log/log.h. I'm trying to straighten out
 >>logging in parallel by passing an MPI communicator to the log
 >>functions, but I can't re-use function names because of the
 >>ellipses. Does anyone know a better solution than using
 >>ellipses, or have suggestions on getting around the problem?
 >>
 >>Garth
 >>
 >>_______________________________________________
 >>fenics mailing list
 >>[email protected]
 >>http://fenicsproject.org/mailman/listinfo/fenics

 _______________________________________________
 fenics mailing list
 [email protected]
 http://fenicsproject.org/mailman/listinfo/fenics

_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to