Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 858
    • Issues 858
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 56
    • Merge requests 56
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !1575

Use C++11 decltype where possible

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Xavier Claessens requested to merge xclaesse/glib:typeof into master Jul 15, 2020
  • Overview 86
  • Commits 4
  • Pipelines 15
  • Changes 9

There are various places glib uses __typeof__ for type safety, but that's a GNUC extension. C++11 has standard decltype() that does a similar job, at least for cases we care about.

This avoids C++ code to always have to cast return value of g_object_ref() which was causing type kind of error:

error: invalid conversion from ‘gpointer’ {aka ‘void*’} to ‘GstElementFactory*’ {aka ‘_GstElementFactory*’} [-fpermissive]

Edited Jul 25, 2020 by Philip Withnall
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: typeof