Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
graph-tool
graph-tool
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tiago Peixoto
  • graph-toolgraph-tool
  • Merge Requests
  • !28

Merged
Opened Jun 06, 2020 by Jeff Trull@jaafarContributor

Remove boost::any wrapper around std::shared_ptr

  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 2

std::shared_ptr provides a limited amount of type erasure natively based on void* and the fact that it stores the original type in the deleter. As a result, if you know the original type, you can call std::static_pointer_cast and recover a legitimate shared_ptr of the right type, very efficiently.

It looks like the use of boost::any in this code is:

  1. to hide the pointed-to type so a uniform container can be used
  2. to represent "no pointer"

both of which can be handled natively by shared_ptr with a small performance gain from removing one indirection.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: count0/graph-tool!28
Source branch: simplify-shared-any

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.