Merge lp://qastaging/~smspillaz/compiz-core/compiz-core.handle-bad-get-exceptions into lp://qastaging/compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 2961
Proposed branch: lp://qastaging/~smspillaz/compiz-core/compiz-core.handle-bad-get-exceptions
Merge into: lp://qastaging/compiz-core/0.9.5
Diff against target: 0 lines
To merge this branch: bzr merge lp://qastaging/~smspillaz/compiz-core/compiz-core.handle-bad-get-exceptions
Reviewer Review Type Date Requested Status
Alan Griffiths Needs Fixing
Thomas Voß Approve
Review via email: mp+89903@code.qastaging.launchpad.net

Description of the change

Handle bad_get exceptions in the option getters. Unfortunately that means that the template ::get () must now return a copy (will redesign in future to return a const ref)

To post a comment you must log in.
Revision history for this message
Thomas Voß (thomas-voss) wrote :

LGTM, although error handling should be up to calling code. Nevertheless, we can tackle that problem in the future.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

const T & get () const
{
 try
 {
   return boost::get<T> (mValue);
 }
 catch (...)
 {
    static T inst;
    return inst;
 }
}

review: Needs Fixing
2962. By Sam Spilsbury

Use a static instance

Preview Diff

Empty

Subscribers

People subscribed via source and target branches