Skip to content

convertible_observable_vector::IndexOf slows debugging because it uses exceptions in a non-exceptional case #1013

@mcooley

Description

@mcooley

We have a scenario where some code in XAML repeatedly calls IObservableVector::IndexOf, where value is a different type than the container items. That causes hresult_no_interface to be thrown and caught internally within cppwinrt many times in this code.

All of these exceptions cause ~1s pauses in the debugger and make it difficult for the developer to be productive if they have first-chance exceptions turned on.

It appears that since #695 was merged, IInspectable.try_as is equivalent (?) to unbox_value and could be used in the implementation of IndexOf to avoid this. (Is that true, or did I miss some nuance there?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions