Skip to content

Using TagLib without dynamic_cast and RTTI #731

Open

Description

@flaviotordini

TagLib clients check for a File or Tag implementation by casting, eg:

if (TagLib::MPEG::File *f = dynamic_cast<TagLib::MPEG::File*>(file))

But dynamic_cast is only available when RTTI is enabled. Is there a way of using TagLib without dynamic_cast? If not, consider this a feature request.

Activity

  1. sbooth commented on Apr 2, 2016

    @sbooth
    Contributor

    Could you use the properties() method to get the information you need?

  2. flaviotordini commented on Apr 5, 2016

    @flaviotordini
    Author

    One casts to the specific File or Tag implementations in order to deal with the specifics of the file format. So no, I cannot just use the generic property map.

  3. gioerr commented on Nov 7, 2017

    @gioerr

    A library that requires RTTI to work should be marked broken.

  4. StefanBruens commented on Apr 13, 2018

    @StefanBruens
    Contributor

    An environment that disables RTTI and forces library developers to reinvent the wheel should be marked broken.

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

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