openframeworks / openframeworks/openFrameworks

How to Disable Both OF_LEGACY_INCLUDE_STD and OF_USE_MINIMAL_STD

Open
#8,318 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

I believe that OF_USE_MINIMAL_STD is a best-effort way to maintain compatibility. However, I think it would be good to provide a method to disable it entirely as well.

For example, like the following:

#ifndef OF_DISABLE_INCLUDE_STD
    #ifdef OF_LEGACY_INCLUDE_STD
using namespace std;
    #else

// this will eventually be disabled by default
        #define OF_USE_MINIMAL_STD
        #ifdef OF_USE_MINIMAL_STD
using std::cout;
using std::deque;
using std::endl;
using std::make_shared;
using std::map;
using std::max;
using std::pair;
using std::shared_ptr;
using std::string;
using std::stringstream;
using std::swap;
using std::to_string;
using std::vector;
using std::weak_ptr;
        #endif // OF_USE_MINIMAL_STD
    #endif // OF_LEGACY_INCLUDE_STD
#endif // ifndef OF_DISABLE_INCLUDE_STD

This is a method that ignores both using statements by defining OF_DISABLE_INCLUDE_STD.
Is there a better approach?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the definitions and uses of OF_LEGACY_INCLUDE_STD and OF_USE_MINIMAL_STD in the C++ configuration or header code, then trace how their using declarations affect consumers. Review the existing compatibility behavior and determine whether a separate opt-out is appropriate; done means the chosen behavior is implemented and verified without breaking supported configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.