Example #1
0
    char const* check_description_a_()
    {
        if( NULL == m_description_a &&
            NULL != m_description)
        {
            int cch = ::WideCharToMultiByte(0, 0, m_description, -1, NULL, 0, NULL, NULL);

            m_description_a = static_cast<char*>(::CoTaskMemAlloc((1 + cch) * sizeof(char)));

            if(NULL == m_description_a)
            {
#ifdef STLSOFT_CF_THROW_BAD_ALLOC
                STLSOFT_THROW_X(stlsoft_ns_qual_std(bad_alloc)());
#endif /* STLSOFT_CF_THROW_BAD_ALLOC */
            }
            else
            {
                ::WideCharToMultiByte(0, 0, m_description, -1, m_description_a, 1 + cch, NULL, NULL);
            }
        }

        return (NULL == m_description_a) ? "" : m_description_a;
    }
        7
        8
\endcode
 *
 * \param V The value type.
 * \param C The character type. Defaults to <code>char</code>.
 * \param T The traits type. Defaults to <code>std::char_traits&lt;C></code>.
 * \param S The string type. Defaults to <code>std::basic_string&lt;C></code>.
 *
 * \remarks The class template avoids fatuous assignment syntax by using the
 *  \ref group__pattern__dereference_proxy "Dereference Proxy" pattern.
 */
template<   ss_typename_param_k V
            ,   ss_typename_param_k C = char
            ,   ss_typename_param_k T = stlsoft_ns_qual_std(char_traits)<C>
            ,   ss_typename_param_k S = stlsoft_ns_qual_std(basic_string)<C, T>
            >
// [[synesis:class:iterator: ostream_iterator<T<V>, T<C>, T<T>, T<S>>]]
class ostream_iterator
    : public stlsoft_ns_qual(iterator_base)<stlsoft_ns_qual_std(output_iterator_tag), void, void, void, void>
{
/// \name Member Types
/// @{
public:
    /// The value type
    typedef V                                       assigned_type;
    /// The character type
    typedef C                                       char_type;
    /// The traits type
    typedef T                                       traits_type;
    /// The string type
 * classes.
 *
 * \ingroup group__library__iterators
 *
 * \param I The iterator to be adapted for reverse iteration
 * \param T The value type
 * \param R The reference type
 * \param P The pointer type
 * \param D The distance type
 */
template<   ss_typename_param_k I
#if defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT) && \
    !defined(STLSOFT_COMPILER_IS_BORLAND) && \
    (   !defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) || \
        STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION >= STLSOFT_CF_DINKUMWARE_VC_VERSION_7_1)
        ,   ss_typename_param_k T = ss_typename_type_def_k stlsoft_ns_qual_std(iterator_traits)<I>::value_type
#else /* ? compiler */
        ,   ss_typename_param_k T
#endif /* compiler */
        ,   ss_typename_param_k R = T&
        ,   ss_typename_param_k P = T*
        ,   ss_typename_param_k D = ss_ptrdiff_t
#if defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT) && \
    !defined(STLSOFT_COMPILER_IS_BORLAND) && \
    (   !defined(STLSOFT_CF_STD_LIBRARY_IS_DINKUMWARE_VC) || \
        STLSOFT_CF_STD_LIBRARY_DINKUMWARE_VC_VERSION >= STLSOFT_CF_DINKUMWARE_VC_VERSION_7_1)
        ,   ss_typename_param_k C = ss_typename_type_def_k stlsoft_ns_qual_std(iterator_traits)<I>::iterator_category
#else /* ? STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
        ,   ss_typename_param_k C = stlsoft_ns_qual_std(input_iterator_tag)
#endif /* STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
        >
Example #4
0
}
#  endif /* compiler */

/** \brief \ref group__concept__shim__string_access__c_str_data function
 *    for specialisations of <code>std::basic_string</code> with
 *    <code>char</code>.
 *
 * \ingroup group__concept__shim__string_access
 *
 * \return None-NULL, non-mutating pointer to a C-style
 *   string of <code>char</code>.
 */
template<   ss_typename_param_k T
        ,   ss_typename_param_k A
        >
inline ss_char_a_t const* c_str_data_a(stlsoft_ns_qual_std(basic_string)<ss_char_a_t, T, A> const& s)
{
    return s.data();
}

/** \brief \ref group__concept__shim__string_access__c_str_data function
 *    for specialisations of <code>std::basic_string</code> with
 *    <code>wchar_t</code>.
 *
 * \ingroup group__concept__shim__string_access
 *
 * \return None-NULL, non-mutating pointer to a C-style
 *   string of <code>wchar_t</code>.
 */
template<   ss_typename_param_k T
        ,   ss_typename_param_k A