Skip to content

default arguments cannot be added to a function template that has already been declared #2

Description

@ryandesign

iulib cannot be compiled on OS X 10.11 El Capitan using clang. The error is:

g++ -o imglib/imgops.os -c -g -fPIC -fPIC -I. -Icolib -Iimglib -Iimgio -Iimgbits -Iutils -Icomponents -Ividio -I/opt/local/include imglib/imgops.cc
In file included from imglib/imgops.cc:35:
In file included from ./colib/colib.h:37:
colib/env.h:36:17: warning: using directive refers to implicitly-defined namespace 'std'
using namespace std;
                ^
imglib/imgops.cc:136:15: error: default arguments cannot be added to a function template that has already been declared
            V scale=1,int dx=0,int dy=0) {
              ^     ~
imglib/imgops.h:70:10: note: previous template declaration is here
    void addscaled(colib::narray<T> &, colib::narray<T> &, V, int, int);
         ^
imglib/imgops.cc:136:27: error: default arguments cannot be added to a function template that has already been declared
            V scale=1,int dx=0,int dy=0) {
                          ^  ~
imglib/imgops.h:70:10: note: previous template declaration is here
    void addscaled(colib::narray<T> &, colib::narray<T> &, V, int, int);
         ^
imglib/imgops.cc:136:36: error: default arguments cannot be added to a function template that has already been declared
            V scale=1,int dx=0,int dy=0) {
                                   ^  ~
imglib/imgops.h:70:10: note: previous template declaration is here
    void addscaled(colib::narray<T> &, colib::narray<T> &, V, int, int);
         ^
1 warning and 3 errors generated.
scons: *** [imglib/imgops.os] Error 1
scons: building terminated because of errors.

This was reported to the MacPorts project in 2014:

https://trac.macports.org/ticket/42353

And reported to iulib on Google Code:

https://code.google.com/p/iulib/issues/detail?id=45

But then the project moved to GitHub and the Google Code issues do not appear to have been preserved, so I am reporting it here again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions