Skip to content

Scoping error when creating the parser object #2

@pbuendia

Description

@pbuendia

A scoping error was hidden in this line:
parser_t parser = ( args.fastq ) ? parser_t( args.fastq ) : parser_t( args.fasta, args.qual );

One shouldn't create an object within a conditional statement and use it after the conditional statement as it will lose scope, "parser" in this case. It works in Linux, but it shouldn't.
One solution is to modify the constructor to include the conditional statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions