|
1 | 1 | /* |
2 | | - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
73 | 73 | // This file holds all globally used constants & types, class (forward) |
74 | 74 | // declarations and a few frequently used utility functions. |
75 | 75 |
|
76 | | -// Declare the named class to be noncopyable. This macro must be used in |
77 | | -// a private part of the class's definition, followed by a semi-colon. |
78 | | -// Doing so provides private declarations for the class's copy constructor |
79 | | -// and assignment operator. Because these operations are private, most |
80 | | -// potential callers will fail to compile because they are inaccessible. |
81 | | -// The operations intentionally lack a definition, to provoke link-time |
82 | | -// failures for calls from contexts where they are accessible, e.g. from |
83 | | -// within the class or from a friend of the class. |
84 | | -// Note: The lack of definitions is still not completely bullet-proof, as |
85 | | -// an apparent call might be optimized away by copy elision. |
86 | | -// For C++11 the declarations should be changed to deleted definitions. |
87 | | -#define NONCOPYABLE(C) C(C const&); C& operator=(C const&) /* next token must be ; */ |
| 76 | +// Declare the named class to be noncopyable. This macro must be followed by |
| 77 | +// a semi-colon. The macro provides deleted declarations for the class's copy |
| 78 | +// constructor and assignment operator. Because these operations are deleted, |
| 79 | +// they cannot be defined and potential callers will fail to compile. |
| 80 | +#define NONCOPYABLE(C) C(C const&) = delete; C& operator=(C const&) = delete /* next token must be ; */ |
| 81 | + |
88 | 82 |
|
89 | 83 | //---------------------------------------------------------------------------------------------------- |
90 | 84 | // Printf-style formatters for fixed- and variable-width types as pointers and |
|
0 commit comments