Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
69b40ce1
Commit
69b40ce1
authored
14 years ago
by
Jorrit Fahlke
Browse files
Options
Downloads
Patches
Plain Diff
[DUNE_DEPRECATED] Update documentation on how to use this in different cases.
[[Imported from SVN: r6254]]
parent
3104ff73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/deprecated.hh
+36
-5
36 additions, 5 deletions
dune/common/deprecated.hh
with
36 additions
and
5 deletions
dune/common/deprecated.hh
+
36
−
5
View file @
69b40ce1
...
...
@@ -25,12 +25,43 @@
* Here are some examples how to mark different stuff deprecated:
* - Classes
* \code
class DUNE_DEPRECATED Class {};
class Class {} DUNE_DEPRECATED;
class DUNE_DEPRECATED Class {};
// 1)
class Class {} DUNE_DEPRECATED;
// 2)
* \endcode
* This does not seem to work for template classes. If the class template
* has some essential member, maybe you can get away by marking that as
* deprecated instead.
* Both forms do not work properly with g++-4.1: no deprecation warning
* will be given, although the code still compiles. 1) should be preferred
* over 2) since 2) does not work with clang++-1.1 (again, no warning given
* but code still compiles)
* - Template classes
* \code
template<class T>
class DUNE_DEPRECATED Class {}; // 1)
template<class T>
class Class {} DUNE_DEPRECATED; // 2)
* \endcode
* This works works with g++-4.3, g++-4.4 and g++-4.5 only, g++-4.1 and
* clang++ compile the code without warning in both cases. Furthermore,
* the warning is only triggered when copying an object of that template
* class, neither making a typedef nor simply creating such an object emit
* the warning. It is thus recommended that some essential class member be
* marked deprecated as well, if possible.
* - Member constants
* \code
template<typename T> struct Class {
static const int c0 DUNE_DEPRECATED = 0;
static const int DUNE_DEPRECATED c1 = 1;
};
* \endcode
* Works with g++-4.1, g++-4.3, g++-4.4, g++-4.5. No warning but clean
* compile with clang++-1.1.
* - Member enumerators
* \code
template<typename T> struct Class {
enum enumeration { enumerator = 0 };
};
* \endcode
* No form of deprecation is known that does not trigger an error on most
* compilers.
* - Member functions
* \code
template<typename T> struct Class {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment