New macro to downcast shared pointers.
* spot/misc/casts.hh: Add a macro down_pointer_cast.
This commit is contained in:
parent
5952392494
commit
2fbc75f439
1 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2011, 2015 Laboratoire de Recherche et Développement
|
// Copyright (C) 2011, 2015-2016 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -29,7 +29,13 @@
|
||||||
// on error, which the assert catches.
|
// on error, which the assert catches.
|
||||||
|
|
||||||
#if NDEBUG
|
#if NDEBUG
|
||||||
# define down_cast static_cast
|
# define down_cast static_cast
|
||||||
#else
|
#else
|
||||||
# define down_cast dynamic_cast
|
# define down_cast dynamic_cast
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if NDEBUG
|
||||||
|
# define down_pointer_cast std::static_pointer_cast
|
||||||
|
#else
|
||||||
|
# define down_pointer_cast std::dynamic_pointer_cast
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue