Changes between Initial Version and Version 1 of Ticket #9201, comment 1
- Timestamp:
- Feb 18, 2014, 12:38:56 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #9201, comment 1
initial v1 1 1 I think the only way to fix this is to have the following approach: 2 3 TT* b_ptr = NULL;4 if (b_ptr) {5 TT& b = *b_ptr;6 TT a(b); // Though I wonder if this shouldn't require an implicit copy constructor.7 TT* ptr = &a;8 ...9 }10 2 {{{ 3 TT* b_ptr = NULL; 4 if (b_ptr) { 5 TT& b = *b_ptr; 6 TT a(b); // Though I wonder if this shouldn't require an implicit copy constructor. 7 TT* ptr = &a; 8 ... 9 } 10 }}} 11 11 This is the only way I can think of to create an object of type TT without relying on default construction, while also not invoking undefined behavior and also having it require compilation. 12 12