Difference between revisions of "C++11"

From Inkscape Wiki
Jump to navigation Jump to search
Line 10: Line 10:
 
|-
 
|-
 
| std::unique_ptr<>
 
| std::unique_ptr<>
|not yet
+
| not yet
 
| replaces boost::scoped_ptr<> and std::auto_ptr<>
 
| replaces boost::scoped_ptr<> and std::auto_ptr<>
 
|-
 
|-
 
| std::shared_ptr<>
 
| std::shared_ptr<>
 
| not yet
 
| not yet
|
+
| replaces boost::shared_ptr<>
 
|-
 
|-
 
| std::unordered_*<>
 
| std::unordered_*<>
Line 23: Line 23:
 
| auto (type inference)
 
| auto (type inference)
 
| not yet
 
| not yet
|  
+
|
 
|-
 
|-
 
| enum class
 
| enum class
Line 51: Line 51:
 
| toxic feature of doom
 
| toxic feature of doom
 
| style="background:Red;"| NO
 
| style="background:Red;"| NO
| Never use this (in case we stumble upon C++11 features that we really don't like
+
| Never use this (in case we stumble upon C++11 features that we really don't like)
 
|-
 
|-
 
| supported feature
 
| supported feature

Revision as of 00:41, 6 March 2014

C++11 usage status

The table lists C++11 features and whether they can be used in Inkscape or not (yet). Add C++11 features that you would like to use to the table, so that we know what to test for to increase the C++11 "allowance".

Feature Can use? Comment
std::unique_ptr<> not yet replaces boost::scoped_ptr<> and std::auto_ptr<>
std::shared_ptr<> not yet replaces boost::shared_ptr<>
std::unordered_*<> replaces the hack in util/unordered-containers.h
auto (type inference) not yet
enum class not yet
range-based for not yet
lambda functions not yet in-place defitions for small functions
constructor delegation not yet reduces boilerplate when an object has many constructors
right angle brackets in templates not yet fixes coding style oddity
async, futures not yet allows easy multithreading
toxic feature of doom NO Never use this (in case we stumble upon C++11 features that we really don't like)
supported feature from 0.50

C++11 platform status

Also see this page http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport

Note that "__cplusplus" is always "1" for GCC 4.6 that is used on Windows. So "#if __cplusplus < 201103L" or variants does not work to choose between C++03 or C++11 code.

The table lists C++11 features and whether they work in trunk on a certain platform as advertised. If all lights are green -> set the light to green in the [C++11 usage status] section (taking current trunk version into account).

Windows Mac Linux A Linux B Comment
Feature TDM-GCC 4.6
unique_ptr<>
shared_ptr<>
auto
enum class
range-based for