minix/external/bsd/libc++/dist/libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
Lionel Sambuc 4684ddb6aa LLVM Minix changes
- import libcxx
 - reduce targets to the one when compiled as a tools

Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
2014-07-28 17:05:59 +02:00

48 lines
1.7 KiB
C++

//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <locale>
// template <class charT>
// class numpunct
// : public locale::facet
// {
// public:
// typedef charT char_type;
// typedef basic_string<charT> string_type;
// static locale::id id;
#include <locale>
#include <type_traits>
#include <cassert>
int main()
{
std::locale l = std::locale::classic();
{
assert(std::has_facet<std::numpunct<char> >(l));
const std::numpunct<char>& f = std::use_facet<std::numpunct<char> >(l);
{
(void)std::numpunct<char>::id;
}
static_assert((std::is_same<std::numpunct<char>::char_type, char>::value), "");
static_assert((std::is_same<std::numpunct<char>::string_type, std::string>::value), "");
static_assert((std::is_base_of<std::locale::facet, std::numpunct<char> >::value), "");
}
{
assert(std::has_facet<std::numpunct<wchar_t> >(l));
const std::numpunct<wchar_t>& f = std::use_facet<std::numpunct<wchar_t> >(l);
{
(void)std::numpunct<wchar_t>::id;
}
static_assert((std::is_same<std::numpunct<wchar_t>::char_type, wchar_t>::value), "");
static_assert((std::is_same<std::numpunct<wchar_t>::string_type, std::wstring>::value), "");
static_assert((std::is_base_of<std::locale::facet, std::numpunct<wchar_t> >::value), "");
}
}