Skip to content

Commit e3f9d7e

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: Disabling custom ("better") containers in DEBUG mode
Summary: Custom containers are only enabled in release mode. Using custom stuff complicates debugging process because it breaks embedded into IDE introspections mechanisms. Reviewed By: mdvacca Differential Revision: D14508299 fbshipit-source-id: d2dbe87764b17d75ccd544c0a4baf03dd9e0cd0b
1 parent 000bf3d commit e3f9d7e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ReactCommon/better/better.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ namespace better {
4949

5050
/*
5151
* Enables using Folly containers instead of standard ones (such as map, vector,
52-
* string, optional and etc.)
52+
* small_vector, optional and etc.)
53+
* Custom containers are only enabled in release mode. Using custom stuff
54+
* complicates debugging process because it breaks embedded into IDE
55+
* introspections mechanisms.
5356
*/
57+
#ifndef DEBUG
5458
#define BETTER_USE_FOLLY_CONTAINERS
59+
#endif
5560

5661
} // namespace better
5762
} // namespace facebook

ReactCommon/better/optional.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <better/better.h>
1111

12-
#ifdef BETTER_USE_FOLLY_CONTAINERS
12+
#if defined(BETTER_USE_FOLLY_CONTAINERS) || __cplusplus < 202000L
1313

1414
#include <folly/Optional.h>
1515

@@ -22,7 +22,7 @@
2222
namespace facebook {
2323
namespace better {
2424

25-
#ifdef BETTER_USE_FOLLY_CONTAINERS
25+
#if defined(BETTER_USE_FOLLY_CONTAINERS) || __cplusplus < 202000L
2626

2727
template <typename Value>
2828
using optional = folly::Optional<Value>;

0 commit comments

Comments
 (0)