Skip to content

Minimal support for boost::type_erasure::any. #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from . import intrusive_1_55
from . import intrusive_1_40
from . import multi_index_1_42
from . import type_erasure
from .utils import register_printers, add_trivial_printer, options, last_supported_boost_version
from . import datetime
from . import variant
22 changes: 22 additions & 0 deletions boost/type_erasure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# encoding: utf-8
from __future__ import print_function, absolute_import, division
import gdb
from .utils import *

#
# Boost TypeErasure

@add_printer
class BoostTypeErasure:
"Pretty Printer for boost::type_erasure::any (Boost.TypeErasure)"
printer_name = 'boost::type_erasure::any'
min_supported_version = (1, 54, 0)
max_supported_version = last_supported_boost_version
template_name = 'boost::type_erasure::any'

def __init__(self, value):
self.value = value

def to_string(self):
stored_value = self.value['_boost_type_erasure_data']['data']
return '(boost::type_erasure::any<...> data = {})'.format(stored_value)