{"json_modified": "2016-03-28T08:34:47.698822", "uuid": "e8af040a-88e1-4329-ac23-c2c9d0444858", "title": "C++ portability guide", "url": "/en-US/docs/Mozilla/C++_Portability_Guide", "tags": ["Mozilla", "Developer Guide"], "translations": [], "modified": "2016-02-07T13:53:54", "label": "C++ portability guide", "localization_tags": [], "locale": "en-US", "id": 93619, "last_edit": "2016-02-07T13:53:54", "summary": "What follows is a set of rules, guidelines, and tips that we have found to be useful in making C++ code portable across many machines and compilers.", "sections": [{"id": "C_portability_rules", "title": "C++ portability rules"}, {"id": "Don't_use_static_constructors", "title": "Don't use static constructors"}, {"id": "Don't_use_exceptions", "title": "Don't use exceptions"}, {"id": "Don't_use_Run-time_Type_Information", "title": "Don't use Run-time Type Information"}, {"id": "Don't_use_the_C_standard_library_(including_iostream_locale_and_the_STL)", "title": "Don't use the C++ standard library (including iostream, locale, and the STL)"}, {"id": "Use_C_lambdas_but_with_care", "title": "Use C++ lambdas, but with care"}, {"id": "Use_namespaces", "title": "Use namespaces"}, {"id": "Don't_mix_varargs_and_inlines", "title": "Don't mix varargs and inlines"}, {"id": "Don't_use_initializer_lists_with_objects", "title": "Don't use initializer lists with objects"}, {"id": "Make_header_files_compatible_with_C_and_C", "title": "Make header files compatible with C and C++"}, {"id": "Use_override_on_subclass_virtual_member_functions", "title": "Use override on subclass virtual member functions"}, {"id": "Always_declare_a_copy_constructor_and_assignment_operator", "title": "Always declare a copy constructor and assignment operator"}, {"id": "Be_careful_of_overloaded_methods_with_like_signatures", "title": "Be careful of overloaded methods with like signatures"}, {"id": "Type_scalar_constants_to_avoid_unexpected_ambiguities", "title": "Type scalar constants to avoid unexpected ambiguities"}, {"id": "Use_nsCOMPtr_in_XPCOM_code", "title": "Use nsCOMPtr in XPCOM code"}, {"id": "Don't_use_identifiers_that_start_with_an_underscore", "title": "Don't use identifiers that start with an underscore"}, {"id": "Stuff_that_is_good_to_do_for_C_or_C", "title": "Stuff that is good to do for C or C++"}, {"id": "Avoid_conditional_includes_when_possible", "title": "Avoid conditional #includes when possible"}, {"id": "Every_.cpp_source_file_should_have_a_unique_name", "title": "Every .cpp source file should have a unique name"}, {"id": "Turn_on_warnings_for_your_compiler_and_then_write_warning_free_code", "title": "Turn on warnings for your compiler, and then write warning free code"}, {"id": "Use_the_same_type_for_all_bitfields_in_a_struct_or_class", "title": "Use the same type for all bitfields in a "}, {"id": "Don't_use_an_enum_type_for_a_bitfield", "title": null}, {"id": "Last_updated_April_2015", "title": "Last updated April 2015"}], "slug": "Mozilla/C++_Portability_Guide", "review_tags": []}