pmelsted / bifrost

Bifrost: Highly parallel construction and indexing of colored and compacted de Bruijn graphs
BSD 2-Clause "Simplified" License
204 stars 25 forks source link

A compile error while using the C++ API #5

Closed XiangLiKyle closed 4 years ago

XiangLiKyle commented 4 years ago

I tried to use the function searchSequence in CompactedDBG, and there was error showed:

   include/bifrost/CompactedDBG.tcc:5593:62: error: passing ‘const CompactedDBG<DataAccessor<MyBool>, DataStorage<MyBool> >’ as ‘this’ argument discards qualifiers [-fpermissive]

   const UnitigMap<U, G> um = findUnitig(seqs.c_str(), pos_seq, seqs.length(), mhi);

And I found that searchSequence is a const member function but findUnitig is not. So I modified searchSequence to a non-const member function and no compile error this time.

GuillaumeHolley commented 4 years ago

Good catch! I'm actually going to propose findUnitig() and searchSequence() in const and non-const member functions to be able to work with both ;) As I have some new code for searchSequence() (should be slightly faster than the current one), I will also update that at the same time. Should be ready for tomorrow evening but in the meantime, I keep this issue open.

Thanks!

GuillaumeHolley commented 4 years ago

findUnitig() and searchSequence() are now available as const and non-const member functions.

XiangLiKyle commented 4 years ago

findUnitig() and searchSequence() are now available as const and non-const member functions.

Thank you!