Enqueues a single item (by copying it). Does not allocate memory. Fails if not enough room to enqueue (or implicit production is disabled because Traits::INITIAL_IMPLICIT_PRODUCER_HASH_SIZE is 0). Note: If using only try_enqueue/try_enqueue_bulk with pre-allocated blocks, configure Traits::IMPLICIT_INITIAL_INDEX_SIZE appropriately to ensure the index has sufficient capacity for the number of block
| 1074 | // capacity for the number of blocks each producer may need. |
| 1075 | // Thread-safe. |
| 1076 | inline bool try_enqueue(T const& item) |
| 1077 | { |
| 1078 | MOODYCAMEL_CONSTEXPR_IF (INITIAL_IMPLICIT_PRODUCER_HASH_SIZE == 0) return false; |
| 1079 | else return inner_enqueue<CannotAlloc>(item); |
| 1080 | } |
| 1081 | |
| 1082 | // Enqueues a single item (by moving it, if possible). |
| 1083 | // Does not allocate memory (except for one-time implicit producer). |