BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmf_util.h
Go to the documentation of this file.
1/// @file bslmf_util.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslmf_util.h -*-C++-*-
8#ifndef INCLUDED_BSLMF_UTIL
9#define INCLUDED_BSLMF_UTIL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslmf_util bslmf_util
15/// @brief Provide low-level functions on `bslmf` types.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslmf
19/// @{
20/// @addtogroup bslmf_util
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslmf_util-purpose"> Purpose</a>
25/// * <a href="#bslmf_util-classes"> Classes </a>
26/// * <a href="#bslmf_util-description"> Description </a>
27/// * <a href="#bslmf_util-bslmf-util-forward"> bslmf::Util::forward </a>
28/// * <a href="#bslmf_util-bslmf-util-forwardasreference"> bslmf::Util::forwardAsReference </a>
29/// * <a href="#bslmf_util-bslmf-util-moveifsupported"> bslmf::Util::moveIfSupported </a>
30/// * <a href="#bslmf_util-usage"> Usage </a>
31/// * <a href="#bslmf_util-example-1-using-bslmf-util-forward"> Example 1: Using bslmf::Util::forward </a>
32/// * <a href="#bslmf_util-example-2-using-bslmf-util-forwardasreference"> Example 2: Using bslmf::Util::forwardAsReference </a>
33/// * <a href="#bslmf_util-example-3-using-bslmf-util-moveifsupported"> Example 3: Using bslmf::Util::moveIfSupported </a>
34///
35/// # Purpose {#bslmf_util-purpose}
36/// Provide low-level functions on `bslmf` types.
37///
38/// # Classes {#bslmf_util-classes}
39///
40/// - bslmf::Util: utility class providing low-level functionality
41///
42/// # Description {#bslmf_util-description}
43/// This component defines a utility `struct`, `bslmf::Util`, that
44/// serves as a namespace for a suite of functions that supply low-level
45/// functionality for implementing portable generic facilities such as might be
46/// found in the C++ standard library.
47///
48/// ## bslmf::Util::forward {#bslmf_util-bslmf-util-forward}
49///
50///
51/// The function `forward` emulates the C++ standard utility function
52/// `std::forward` with the addition that on compilers that don't support
53/// r-value references (i.e., C++03) a `bslmf::MovableRef<t_T>` is forwarded as
54/// a `bslmf::MovableRef<t_T>`. This operation is typically used via
55/// `BSLS_COMPILERFEATURES_FORWARD` (along with
56/// `BSLS_COMPILERFEATURES_FORWARD_REF`) when forwarding arguments in a generic
57/// context. See {Usage}.
58///
59/// ## bslmf::Util::forwardAsReference {#bslmf_util-bslmf-util-forwardasreference}
60///
61///
62/// The function `forwardAsReference`, like `forward`, emulates the C++ standard
63/// utility function `std::forward` with the difference that on compilers that
64/// don't support r-value references (C++03) a `bslmf::MovableRef<t_T>` is
65/// forwarded as `const t_T&` (instead of `bslmf::MovableRef<t_T>`). This
66/// operation is intended to be used when forwarding a `MovableRef<t_T>` where
67/// that `MovableRef` is being supplied to a function that does not support
68/// `move` emulation, but will support true C++11 r-value references (e.g.,
69/// `bdlf::BindUtil::bind`).
70///
71/// ## bslmf::Util::moveIfSupported {#bslmf_util-bslmf-util-moveifsupported}
72///
73///
74/// The function `moveIfSupported` emulates the C++ standard utility function
75/// `std::move` with the addition that on compilers that don't support r-value
76/// references (i.e., C++03) an l-value reference is returned instead. This
77/// operation is intended to be used when moving an object to a function that
78/// does not support `move` emulation, but will support true C++11 r-value
79/// references (e.g., `bdlf::BindUtil::bind`).
80///
81/// ## Usage {#bslmf_util-usage}
82///
83///
84/// This section illustrates intended use of this component.
85///
86/// ## Example 1: Using bslmf::Util::forward {#bslmf_util-example-1-using-bslmf-util-forward}
87///
88///
89/// Clients should generally not use `bslmf::Util::forward` directly, instead it
90/// should be used via `BSLS_COMPILERFEATURES_FORWARD` in conjunction with
91/// `BSLS_COMPILERFEATURES_FORWARD_REF`. Here we show a simple function using
92/// `BSLS_COMPILERFEATURES_FORWARD`:
93/// @code
94/// template <class RESULT_TYPE>
95/// struct FactoryUtil {
96///
97/// template <class ARG_TYPE>
98/// RESULT_TYPE create(BSLS_COMPILERFEATURES_FORWARD_REF(ARG_TYPE) arg) {
99/// return RESULT_TYPE(BSLS_COMPILERFEATURES_FORWARD(ARG_TYPE, arg));
100/// }
101/// };
102/// @endcode
103/// Notice that `bslmf::Util::forward` is only used in conjunction with
104/// `BSLS_COMPILERFEATURES_FORWARD_REF` because, in the example above, if the
105/// `create` function's parameter type was `ARG_TYPE&& ` then it is a
106/// C++11-only(!) forwarding reference, and we would simply use the standard
107/// `std::forward`. Alternatively, if the parameter type was
108/// `MovableRef<ARG_TYPE>` then `arg` is *not* a forwarding-reference to be
109/// forwarded (certainly not in C++03).
110///
111/// ## Example 2: Using bslmf::Util::forwardAsReference {#bslmf_util-example-2-using-bslmf-util-forwardasreference}
112///
113///
114/// Suppose we have a class `S1` that has a regular copy constructor, and only
115/// if the compiler supports rvalue references has to move constructor. We want
116/// to construct it with the move constructor if moves are supported and as a
117/// copy otherwise. Then we use `bslmf::Util::forwardAsReference`:
118/// @code
119/// struct S {
120/// S();
121/// S(const S&);
122/// #ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
123/// S(S&&);
124/// #endif
125/// };
126///
127/// S::S() {}
128///
129/// S::S(const S&)
130/// {
131/// printf("S copy c'tor\n");
132/// }
133///
134/// #ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
135/// S::S(S&&)
136/// {
137/// printf("S move c'tor\n");
138/// }
139/// #endif
140///
141/// void doThis2(S s)
142/// {
143/// // ...
144/// }
145///
146/// void doThat2(bslmf::MovableRef<S> value)
147/// {
148/// doThis2(bslmf::Util::forwardAsReference<S>(value));
149/// }
150/// @endcode
151///
152/// ## Example 3: Using bslmf::Util::moveIfSupported {#bslmf_util-example-3-using-bslmf-util-moveifsupported}
153///
154///
155/// Suppose we had a function that takes a non-const lvalue-ref, and only when
156/// the compiler supports rvalue references also has an overload that takes
157/// rvalue references:
158/// @code
159/// void doSomething(S&)
160/// {
161/// printf("doSomething lvalue-ref\n");
162/// }
163///
164/// #ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
165/// void doSomething(S&&)
166/// {
167/// printf("doSomething rvalue-ref\n");
168/// }
169/// #endif
170///
171/// void doSomethingElse(S value)
172/// {
173/// doSomething(bslmf::Util::moveIfSupported(value));
174/// }
175/// @endcode
176/// @}
177/** @} */
178/** @} */
179
180/** @addtogroup bsl
181 * @{
182 */
183/** @addtogroup bslmf
184 * @{
185 */
186/** @addtogroup bslmf_util
187 * @{
188 */
189
190#include <bslscm_version.h>
191
194#include <bslmf_movableref.h>
196
197#include <bsla_nodiscard.h>
198
200#include <bsls_cpp11.h>
201#include <bsls_keyword.h>
202
203
204
205namespace bslmf {
206
207 // ===========
208 // struct Util
209 // ===========
210
211/// This struct provides several functions that are specified in the
212/// <utility> header of the C++ Standard, in order to support the `bsl`
213/// library implementation without cycles into the native standard library,
214/// and on platforms with only C++03 compilers available, where library
215/// features may be emulated.
216struct Util {
217
218 // CLASS METHODS
219#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
220 template <class t_TYPE>
221 BSLS_KEYWORD_CONSTEXPR static t_TYPE&& forward(
222 typename bsl::remove_reference<t_TYPE>::type& t) BSLS_KEYWORD_NOEXCEPT;
223 template <class t_TYPE>
224 BSLS_KEYWORD_CONSTEXPR static t_TYPE&& forward(
225 typename bsl::remove_reference<t_TYPE>::type&& t) BSLS_KEYWORD_NOEXCEPT;
226#else
227 template <class t_TYPE>
228 BSLS_KEYWORD_CONSTEXPR static const t_TYPE& forward(
229 const t_TYPE& t) BSLS_KEYWORD_NOEXCEPT;
230 template <class t_TYPE>
233#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
234 // Correctly forward the specified 't' argument based on the current
235 // compilation environment.
236
237#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
238 template <class t_MODEL, class t_TYPE>
241 const typename bsl::remove_reference<t_TYPE>::type&
243 t_TYPE&& t,
244 typename bsl::enable_if<
247 typename bsl::remove_reference<t_MODEL>::type>::value>::type * = 0)
249 template <class t_MODEL, class t_TYPE>
252 t_TYPE&
254 t_TYPE&& t,
255 typename bsl::enable_if<
256 bsl::is_lvalue_reference<t_MODEL>::value &&
257 !bsl::is_const<
258 typename bsl::remove_reference<t_MODEL>::type>::value>::type * = 0)
260 template <class t_MODEL, class t_TYPE>
263 const typename bsl::remove_reference<t_TYPE>::type&&
265 t_TYPE&& t,
266 typename bsl::enable_if<
267 !bsl::is_lvalue_reference<t_MODEL>::value &&
268 bsl::is_const<
269 typename bsl::remove_reference<t_MODEL>::type>::value>::type * = 0)
271 template <class t_MODEL, class t_TYPE>
274 typename bsl::remove_reference<t_TYPE>::type&&
276 t_TYPE&& t,
277 typename bsl::enable_if<
278 !bsl::is_lvalue_reference<t_MODEL>::value &&
279 !bsl::is_const<
280 typename bsl::remove_reference<t_MODEL>::type>::value>::type * = 0)
282#else
283 template <class t_MODEL, class t_TYPE>
286 const t_TYPE&
289 typename bsl::enable_if<
292 t_MODEL>::type>::value>::type * = 0)
294 template <class t_MODEL, class t_TYPE>
297 const t_TYPE&
299 t_TYPE& t,
300 typename bsl::enable_if<
301 bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
302 bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
303 t_MODEL>::type>::value>::type * = 0)
305 template <class t_MODEL, class t_TYPE>
308 t_TYPE&
310 bslmf::MovableRef<t_TYPE> t,
311 typename bsl::enable_if<
312 bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
313 !bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
314 t_MODEL>::type>::value>::type * = 0)
316 template <class t_MODEL, class t_TYPE>
319 t_TYPE&
321 t_TYPE& t,
322 typename bsl::enable_if<
323 bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
324 !bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
325 t_MODEL>::type>::value>::type * = 0)
327 template <class t_MODEL, class t_TYPE>
330 MovableRef<const t_TYPE>
332 bslmf::MovableRef<t_TYPE> t,
333 typename bsl::enable_if<
334 !bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
335 bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
336 t_MODEL>::type>::value>::type * = 0)
338 template <class t_MODEL, class t_TYPE>
341 MovableRef<const t_TYPE>
343 t_TYPE& t,
344 typename bsl::enable_if<
345 !bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
346 bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
347 t_MODEL>::type>::value>::type * = 0)
349 template <class t_MODEL, class t_TYPE>
352 MovableRef<t_TYPE>
354 bslmf::MovableRef<t_TYPE> t,
355 typename bsl::enable_if<
356 !bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
357 !bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
358 t_MODEL>::type>::value>::type * = 0)
360 template <class t_MODEL, class t_TYPE>
363 MovableRef<t_TYPE>
365 t_TYPE& t,
366 typename bsl::enable_if<
367 !bslmf::MovableRefUtil::IsLvalueReference<t_MODEL>::value &&
368 !bsl::is_const<typename bslmf::MovableRefUtil::RemoveReference<
369 t_MODEL>::type>::value>::type * = 0)
371#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
372 // Return an lvalue reference to the specified 't' if the (template
373 // parameter) 't_MODEL' is an lvalue reference; otherwise, return
374 // either an rvalue reference or a 'bslmf::MovableRef' referring to
375 // 't', depending on the current compilation environment. The const
376 // type qualifier is added to the result referenced type if 't_MODEL'
377 // is a const-qualified type or reference thereof.
378
379#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
380 template <class t_TYPE>
382 typename bsl::add_rvalue_reference<t_TYPE>::type
384#else
385 template <class t_TYPE>
389#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
390 // This function has no implementation. It exists to allow for the
391 // appearance of a temporary object of the specified type that can be
392 // used in unevaluated contexts.
393
394#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
395 template <class t_TYPE>
397 typename bsl::remove_reference<t_TYPE>::type& t) BSLS_KEYWORD_NOEXCEPT;
398 template <class t_TYPE>
400 typename bsl::remove_reference<t_TYPE>::type&& t) BSLS_KEYWORD_NOEXCEPT;
401#else
402 template <class t_TYPE>
403 BSLS_KEYWORD_CONSTEXPR static const t_TYPE& forwardAsReference(
404 const t_TYPE& t) BSLS_KEYWORD_NOEXCEPT;
405 template <class t_TYPE>
406 BSLS_KEYWORD_CONSTEXPR static const t_TYPE& forwardAsReference(
408#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
409 // Correctly forward the specified 't' argument as a reference type
410 // based on the current compilation environment. Note that this
411 // function differs from 'forward' in that when using a C++03 compiler,
412 // 'MovableRef<t_T>' is forwarded as 'const t_T&' (rather than
413 // 'MovableRef<t_T>'), which is important when forwarding to a facility
414 // (e.g., 'bdlf::BindUtil::bind') which does not support
415 // 'bslmf::MovableRef'.
416
417#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
418 template <class t_TYPE>
420 typename bsl::remove_reference<t_TYPE>::type&&
422#else
423 template <class t_TYPE>
424 BSLS_KEYWORD_CONSTEXPR static typename bsl::remove_reference<t_TYPE>::type&
426#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
427 // Return an r-value reference to the specified 't' argument. If
428 // r-value references are not supported, return an l-value reference.
429};
430
431// ============================================================================
432// INLINE FUNCTION DEFINITIONS
433// ============================================================================
434
435 // -----------
436 // struct Util
437 // -----------
438// CLASS METHODS
439#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
440template <class t_TYPE>
442t_TYPE&& Util::forward(
443 typename bsl::remove_reference<t_TYPE>::type& t) BSLS_KEYWORD_NOEXCEPT
444{
445 return static_cast<t_TYPE&&>(t);
446}
447
448template <class t_TYPE>
450t_TYPE&& Util::forward(
451 typename bsl::remove_reference<t_TYPE>::type&& t) BSLS_KEYWORD_NOEXCEPT
452{
453 return static_cast<t_TYPE&&>(t);
454}
455
456#else
457
458template <class t_TYPE>
460const t_TYPE& Util::forward(const t_TYPE& t) BSLS_KEYWORD_NOEXCEPT
461{
462 return t;
463}
464
465template <class t_TYPE>
472#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
473
474#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
475template <class t_MODEL, class t_TYPE>
477const typename bsl::remove_reference<t_TYPE>::type&
479 t_TYPE&& t,
480 typename bsl::enable_if<
483 typename bsl::remove_reference<t_MODEL>::type>::value>::type *)
485{
486 return t;
487}
488
489template <class t_MODEL, class t_TYPE>
491t_TYPE&
493 t_TYPE&& t,
494 typename bsl::enable_if<
497 typename bsl::remove_reference<t_MODEL>::type>::value>::type *)
499{
500 return static_cast<t_TYPE&>(t);
501}
502
503template <class t_MODEL, class t_TYPE>
505const typename bsl::remove_reference<t_TYPE>::type&&
507 t_TYPE&& t,
508 typename bsl::enable_if<
511 typename bsl::remove_reference<t_MODEL>::type>::value>::type *)
513{
514 return static_cast<typename bsl::remove_reference<t_TYPE>::type&&>(t);
515}
516
517template <class t_MODEL, class t_TYPE>
519typename bsl::remove_reference<t_TYPE>::type&&
521 t_TYPE&& t,
522 typename bsl::enable_if<
525 typename bsl::remove_reference<t_MODEL>::type>::value>::type *)
527{
528 return static_cast<typename bsl::remove_reference<t_TYPE>::type&&>(t);
529}
530#else
531template <class t_MODEL, class t_TYPE>
533const t_TYPE&
536 typename bsl::enable_if<
539 t_MODEL>::type>::value>::type *)
541{
542 return static_cast<const t_TYPE&>(t);
543}
544
545template <class t_MODEL, class t_TYPE>
547const t_TYPE&
549 t_TYPE& t,
550 typename bsl::enable_if<
553 t_MODEL>::type>::value>::type *)
555{
556 return static_cast<const t_TYPE&>(t);
557}
558
559template <class t_MODEL, class t_TYPE>
561t_TYPE&
564 typename bsl::enable_if<
567 t_MODEL>::type>::value>::type *)
569{
570 return static_cast<t_TYPE&>(t);
571}
572
573template <class t_MODEL, class t_TYPE>
575t_TYPE&
577 t_TYPE& t,
578 typename bsl::enable_if<
581 t_MODEL>::type>::value>::type *)
583{
584 return t;
585}
586
587template <class t_MODEL, class t_TYPE>
592 typename bsl::enable_if<
595 t_MODEL>::type>::value>::type *)
597{
598 return bslmf::MovableRefUtil::move(static_cast<const t_TYPE&>(t));
599}
600
601template <class t_MODEL, class t_TYPE>
605 t_TYPE& t,
606 typename bsl::enable_if<
609 t_MODEL>::type>::value>::type *)
611{
612 return bslmf::MovableRefUtil::move(static_cast<const t_TYPE&>(t));
613}
614
615template <class t_MODEL, class t_TYPE>
629
630template <class t_MODEL, class t_TYPE>
643#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
644
645#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
646template <class t_TYPE>
649 typename bsl::remove_reference<t_TYPE>::type& t) BSLS_KEYWORD_NOEXCEPT
650{
651 return static_cast<t_TYPE&&>(t);
652}
653
654template <class t_TYPE>
657 typename bsl::remove_reference<t_TYPE>::type&& t) BSLS_KEYWORD_NOEXCEPT
658{
659 return static_cast<t_TYPE&&>(t);
660}
661
662#else
663
664template <class t_TYPE>
667{
668 return t;
669}
670
671template <class t_TYPE>
678#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
679
680#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
681template <class t_T>
683typename bsl::remove_reference<t_T>::type&& Util::moveIfSupported(
684 t_T&& t) BSLS_KEYWORD_NOEXCEPT
685{
686 return static_cast<typename bsl::remove_reference<t_T>::type&&>(t);
687}
688
689#else
690
691template <class t_T>
693typename bsl::remove_reference<t_T>::type& Util::moveIfSupported(
695{
696 return static_cast<typename bsl::remove_reference<t_T>::type&>(t);
697}
698#endif // BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
699
700} // close package namespace
701
702
703#endif
704
705// ----------------------------------------------------------------------------
706// Copyright 2016 Bloomberg Finance L.P.
707//
708// Licensed under the Apache License, Version 2.0 (the "License");
709// you may not use this file except in compliance with the License.
710// You may obtain a copy of the License at
711//
712// http://www.apache.org/licenses/LICENSE-2.0
713//
714// Unless required by applicable law or agreed to in writing, software
715// distributed under the License is distributed on an "AS IS" BASIS,
716// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
717// See the License for the specific language governing permissions and
718// limitations under the License.
719// ----------------------------- END-OF-FILE ----------------------------------
720
721/** @} */
722/** @} */
723/** @} */
Definition bslmf_movableref.h:751
#define BSLA_NODISCARD
Definition bsla_nodiscard.h:320
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlb_printmethods.h:283
Definition bdlbb_blob.h:576
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:129
Definition bslmf_enableif.h:525
Definition bslmf_isconst.h:144
Definition bslmf_islvaluereference.h:125
Definition bslmf_movableref.h:801
Definition bslmf_movableref.h:825
Definition bslmf_movableref.h:791
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1032
Definition bslmf_removereference.h:213
Definition bslmf_util.h:216
static BSLS_KEYWORD_CONSTEXPR bsl::add_lvalue_reference< t_TYPE >::type declval() BSLS_KEYWORD_NOEXCEPT
static BSLS_KEYWORD_CONSTEXPR MovableRef< t_TYPE > forward(MovableRef< t_TYPE > t) BSLS_KEYWORD_NOEXCEPT
static BSLS_KEYWORD_CONSTEXPR const t_TYPE & forward(const t_TYPE &t) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_util.h:460
static BSLS_KEYWORD_CONSTEXPR bsl::remove_reference< t_TYPE >::type & moveIfSupported(t_TYPE &t) BSLS_KEYWORD_NOEXCEPT
static BSLA_NODISCARD BSLS_KEYWORD_CONSTEXPR const t_TYPE & forward_like(bslmf::MovableRef< t_TYPE > t, typename bsl::enable_if< bslmf::MovableRefUtil::IsLvalueReference< t_MODEL >::value &&bsl::is_const< typename bslmf::MovableRefUtil::RemoveReference< t_MODEL >::type >::value >::type *=0) BSLS_KEYWORD_NOEXCEPT
static BSLS_KEYWORD_CONSTEXPR const t_TYPE & forwardAsReference(const t_TYPE &t) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_util.h:666