Skip to content

Commit

Permalink
Don't take address of std::string::method
Browse files Browse the repository at this point in the history
I'm still investigating whether this is legal, but in fact this doesn't
build with clang/libc++:

https://llvm.org/bugs/show_bug.cgi?id=24127
  • Loading branch information
AMDmi3 committed Jul 15, 2015
1 parent 7e295be commit 62c3dd5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/model/Sequence.cpp
Expand Up @@ -378,10 +378,12 @@ static void read_fasta(Sequence& seq, std::istream& input, const F& f) {
reader.read_one_sequence();
}

static void string_append(std::string& target, const std::string& source) {
target.append(source);
}

void InMemorySequence::read_from_file(std::istream& input) {
typedef std::string& (std::string::* StringMethod)(const std::string&);
StringMethod append = &std::string::append;
read_fasta(*this, input, boost::bind(append, &data_, _1));
read_fasta(*this, input, boost::bind(&string_append, boost::ref(data_), _1));
set_size(data_.size());
}

Expand Down

0 comments on commit 62c3dd5

Please sign in to comment.