Skip to content

error C2995: 'void fst::Prune(fst::MutableFst<A> *,const fst::PruneOptions<Arc,ArcFilter> &)': function template has already been defined #6

@jtrmal

Description

@jtrmal

When compiling fstscript I'll get a bunch of errors saying:

1>C:\Users\jtrmal\Documents\openfst\src\include\fst/prune.h(216): error C2064: term does not evaluate to a function taking 0 arguments
1>C:\Users\jtrmal\Documents\openfst\src\include\fst/prune.h(305): error C2064: term does not evaluate to a function taking 0 arguments
1>C:\Users\jtrmal\Documents\openfst\src\include\fst/prune.h(311): error C2995: 'void fst::Prune(const fst::Fst<Arc> &,fst::MutableFst<A> *,const fst::PruneOptions<Arc,ArcFilter> &)': function template has already been defined

I was playing with that and seems it's because of the enable_if magic.
After changing

typename std::enable_if<
              (Arc::Weight::Properties() & kPath) == kPath>::type * = nullptr

to

typename = std::enable_if<
              (Arc::Weight::Properties() & kPath) == kPath>::type

(as http://en.cppreference.com/w/cpp/types/enable_if describes)
I end up with the error

error C2995: 'void fst::Prune(const fst::Fst<Arc> &,fst::MutableFst<A> *,const fst::PruneOptions<Arc,ArcFilter> &)': function template has already been defined

which I think relates to "Notes" in here:
http://en.cppreference.com/w/cpp/types/enable_if

but from there, I have no idea if there is an easy way how to resolve it

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions