public member function
<locale>

std::codecvt::always_noconv

int always_noconv() const throw();
int always_noconv() const noexcept;
Return noconv characteristics
Returns whether conversions between the internal and external types, in either direction, always yield a copy without any real conversion.

If this function returns true for a particular type of codecvt, then its members codecvt::in and codecvt::out always return codecvt_base::noconv.

Internally, this function simply calls the virtual protected member do_always_noconv, which behaves as described above by default.

Parameters

none

Return value

true if codecvt::in and codecvt::out will always result in noconv.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// codecvt::always_noconv example
#include <iostream>       // std::cout, std::boolalpha
#include <locale>         // std::locale, std::codecvt, std::use_facet

int main ()
{
  std::locale loc;

  std::cout << std::boolalpha;

  std::cout << "always_noconv for codecvt<char,char,mbstate_t>: ";
  std::cout << std::use_facet<std::codecvt<char,char,mbstate_t> >(loc).always_noconv();
  std::cout << '\n';

  std::cout << "always_noconv for codecvt<wchar_t,char,mbstate_t>: ";
  std::cout << std::use_facet<std::codecvt<wchar_t,char,mbstate_t> >(loc).always_noconv();
  std::cout << '\n';

  return 0;
}

Output:

always_noconv for codecvt<char,char,mbstate_t>: true
always_noconv for codecvt<wchar_t,char,mbstate_t>: false


Data races

The facet object is accessed.

Exception safety

No-throw guarantee: never throws exceptions.

See also