Boost.Sequence?
- 昨日の続きですが、普通にresizeを提供した方がいい気がする
- このような感じで
[]TCHAR[] []szSrc[][][] = [][]_T[][]([][]"hello, cstring_begin!"[][]);[]
[]std[][]::[][]basic_string[][]<[][]TCHAR[][]> [][]ans[][]([][]szSrc[][]);[]
[]{[]
[]std[][]::[][]vector[][]<[][]TCHAR[][]> [][]str[][];[]
[]stove[][]::[][]resize[][]([][]str[][], [][]100[][]);[][]// pointedはポインタのペアを取り出す[]
[]// begunはbeginをAdaptor風にしたもの(ボツかもしれない)[]
[]_tcscpy[][]([][]str[][]|[][]oven[][]::[][]pointed[][]|[][]oven[][]::[][]begun[][], [][]szSrc[][]); [][]// null-terminateするAPI[][]// null_terminate_rangeは'\0'の手前までのRange[]
[]// auto_sequenceはRangeをSequenceにコピーする[]
[]std[][]::[][]string[] []str_[][] = [][]stove[][]::[][]auto_sequence[][]([][]str[][]|[][]oven[][]::[][]null_terminated[][]);[][]ATLASSERT[][]( [][]oven[][]::[][]equals[][]([][]str[][]|[][]oven[][]::[][]null_terminated[][], [][]ans[][]) );[]
[]ATLASSERT[][]( [][]oven[][]::[][]equals[][]([][]str_[][], [][]ans[][]) );[]
[]}[]
[]{[]
[]WTL[][]::[][]CString[] []str[][];[]
[]stove[][]::[][]resize[][]([][]str[][], [][]100[][]);[]
[]_tcscpy[][]([][]boost[][]::[][]begin[][]([][]str[][]), [][]szSrc[][]);[][]ATLASSERT[][]( [][]oven[][]::[][]equals[][]([][]str[][]|[][]oven[][]::[][]null_terminated[][], [][]ans[][]) );[]
[]}[]
[]{[]
[]ATL[][]::[][]CString[] []str[][];[]
[]stove[][]::[][]resize[][]([][]str[][], [][]100[][]);[]
[]_tcscpy[][]([][]boost[][]::[][]begin[][]([][]str[][]), [][]szSrc[][]);[][]ATLASSERT[][]( [][]oven[][]::[][]equals[][]([][]str[][]|[][]oven[][]::[][]null_terminated[][], [][]ans[][]) );[]
[]}[]