31template <
typename Character>
33static Character*
__cdecl common_gets(
36 _In_ bool const return_early_if_eof_is_first
44 Character* return_value =
result;
49 if (!stdio_traits::validate_stream_is_ansi_if_required(
stdin))
51 return_value =
nullptr;
57 typename stdio_traits::int_type
c = stdio_traits::getc_nolock(
stdin);
58 if (
c == stdio_traits::eof)
60 return_value =
nullptr;
61 if (return_early_if_eof_is_first)
69#pragma warning(disable:__WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY)
70 Character* result_it =
result;
71 while (
c !=
'\n' &&
c != stdio_traits::eof)
73 *result_it++ =
static_cast<Character
>(
c);
74 c = stdio_traits::getc_nolock(
stdin);
87 Character* result_it =
result;
88 while (
c !=
'\n' &&
c != stdio_traits::eof)
93 *result_it++ =
static_cast<Character
>(
c);
96 c = stdio_traits::getc_nolock(
stdin);
#define _CRT_UNBOUNDED_BUFFER_SIZE
#define _RETURN_BUFFER_TOO_SMALL_ERROR(_String, _Size, _Ret)
#define _RESET_STRING(_String, _Size)
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
static WCHAR available[MAX_STRING_RESOURCE_LEN]
char *__cdecl gets(char *const result)
_In_ size_t const result_size_in_characters
wchar_t *__cdecl _getws_s(wchar_t *const result, size_t const result_size_in_characters)
wchar_t *__cdecl _getws(wchar_t *const result)
_In_ size_t const _In_ bool const return_early_if_eof_is_first throw()
char *__cdecl gets_s(char *const result, size_t const result_size_in_characters)
_CRTIMP void __cdecl _unlock_file(_Inout_ FILE *_File)
_CRTIMP void __cdecl _lock_file(_Inout_ FILE *_File)
#define _Out_writes_z_(s)