Skip to content

Fix: catch exceptions by reference#190

Open
lqhl wants to merge 1 commit intojegonzal:masterfrom
lqhl:fix
Open

Fix: catch exceptions by reference#190
lqhl wants to merge 1 commit intojegonzal:masterfrom
lqhl:fix

Conversation

@lqhl
Copy link

@lqhl lqhl commented Jan 14, 2016

When I type a wrong option in command line, boost::po fails to replace the %canonical_option% tag.
For example, PowerGraph should output

Invalid syntax:
         unrecognised option '--threshold'

Instead, it outputs

Invalid syntax:
         unrecognised option %canonical_option%

The reason is that if we don't catch exceptions by reference, we get 'object slicing' which is explained here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant