walaj / SeqLib

C++ htslib/bwa-mem/fermi interface for interrogating sequence data
http://bioinformatics.oxfordjournals.org/content/early/2016/12/21/bioinformatics.btw741.full.pdf+html
Other
132 stars 36 forks source link

Move BamReader forward declaration into SeqLib namespace #31

Closed dnbaker closed 5 years ago

dnbaker commented 5 years ago

This prevents compilation errors such as the following:

bam_reader.cpp: In function ‘int main()’:
bam_reader.cpp:8:1: error: reference to ‘BamReader’ is ambiguous
 BamReader bw;
 ^~~~~~~~~
In file included from bam_reader.cpp:1:0:
/home-1/dbaker49@jhu.edu/work/db/code/sl/SeqLib/SeqLib/BamReader.h:14:7: note: candidates are: class BamReader
 class BamReader;
       ^~~~~~~~~
/home-1/dbaker49@jhu.edu/work/db/code/sl/SeqLib/SeqLib/BamReader.h:116:7: note:                 class SeqLib::BamReader
 class BamReader {

This only occurs when using namespace SeqLib. It seems that the forward declaration was for a distinct type because it occurred in a different namespace.

walaj commented 5 years ago

Great catch -- thank you!