さよならnew

  • これを実装してみました・・・ソースコード
  • VC++GCCのみ対応ですが、どちらもちょっとずつおかしいので怪しい
  • これをポータブルにするは大変だと思う

[]struct[] []A0[][] { [][]A0[][]() { } };[]
[]struct[] []A1[][] { [][]explicit[] []A1[][]([][]int[][]) { } };[]
[]struct[] []A2[][] { [][]A2[][]([][]int[][], [][]int[][]&) { } };[]
[]struct[] []A3[][] { [][]A3[][]([][]int[][]&, [][]int[][], [][]int[][]&) { } };[]
[]struct[] []A4[][] { [][]A4[][]([][]int[][], [][]int[][]&, [][]int[][], [][]int[][]) { } };[]
[]struct[] []A5[][] { [][]A5[][]([][]int[][], [][]int[][]&, [][]int[][]&, [][]int[][]&, [][]int[][]) { } };[]

[]struct[] []S[][] { [][]S[][]([][]char[] []const[][]*, [][]int[][], [][]char[] []const[][]*) { } };[]

[]template[][]< [][]class[] []T[][] >[]
[]void[] []foo[][]([][]std[][]::[][]auto_ptr[][]<[][]T[][]>, [][]std[][]::[][]auto_ptr[][]<[][]T[][]>)[]
[]{ }[]


[]void[] []test[][]()[]
[]{[]
[]int[] []i[][] = [][]0[][];[]
[]int[] []const[] []c[][] = [][]0[][];[]

[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A0[][]> [][]p0[][]([][]pstade[][]::[][]new_[][]<[][]A0[][]>());[]
[] }[]

[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A1[][]> [][]p1[][]([][]pstade[][]::[][]new_[][]<[][]A1[][]>([][]i[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A1[][]> [][]p2[][]([][]pstade[][]::[][]new_[][]<[][]A1[][]>([][]c[][]));[]
[] }[]
[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A2[][]> [][]p1[][]([][]pstade[][]::[][]new_[][]<[][]A2[][]>([][]i[][],[][]i[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A2[][]> [][]p2[][]([][]pstade[][]::[][]new_[][]<[][]A2[][]>([][]i[][],[][]i[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A2[][]> [][]p3[][]([][]pstade[][]::[][]new_[][]<[][]A2[][]>([][]c[][],[][]i[][]));[]
[] }[]
[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A3[][]> [][]p2[][]([][]pstade[][]::[][]new_[][]<[][]A3[][]>([][]i[][],[][]c[][],[][]i[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A3[][]> [][]p1[][]([][]pstade[][]::[][]new_[][]<[][]A3[][]>([][]i[][],[][]i[][],[][]i[][]));[]
[] }[]
[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A4[][]> [][]p1[][]([][]pstade[][]::[][]new_[][]<[][]A4[][]>([][]c[][],[][]i[][],[][]c[][],[][]c[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A4[][]> [][]p2[][]([][]pstade[][]::[][]new_[][]<[][]A4[][]>([][]c[][],[][]i[][],[][]i[][],[][]c[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A4[][]> [][]p3[][]([][]pstade[][]::[][]new_[][]<[][]A4[][]>([][]c[][],[][]i[][],[][]c[][],[][]i[][]));[]
[] }[]
[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A5[][]> [][]p1[][]([][]pstade[][]::[][]new_[][]<[][]A5[][]>([][]c[][],[][]i[][],[][]i[][],[][]i[][],[][]c[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A5[][]> [][]p2[][]([][]pstade[][]::[][]new_[][]<[][]A5[][]>([][]i[][],[][]i[][],[][]i[][],[][]i[][],[][]c[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A5[][]> [][]p3[][]([][]pstade[][]::[][]new_[][]<[][]A5[][]>([][]c[][],[][]i[][],[][]i[][],[][]i[][],[][]i[][]));[]
[]std[][]::[][]auto_ptr[][]<[][]A5[][]> [][]p4[][]([][]pstade[][]::[][]new_[][]<[][]A5[][]>([][]i[][],[][]i[][],[][]i[][],[][]i[][],[][]i[][]));[]
[] }[]
[] {[]
[]std[][]::[][]auto_ptr[][]<[][]A2[][]> [][]ap[][]([][]pstade[][]::[][]new_[][]<[][]A2[][]>([][]i[][],[][]i[][]));[]
[]boost[][]::[][]scoped_ptr[][]<[][]A3[][]> [][]cp[][]([][]pstade[][]::[][]new_[][]<[][]A3[][]>([][]i[][],[][]i[][],[][]i[][]));[]
[]// boost::shared_ptr<A4> sp(pstade::new_<A4>(i,i,i,i)); // Boost v1.34 -[]
[] }[]

[] {[]
[] ::[][]foo[][]([]
[]pstade[][]::[][]new_[][]<[][]S[][]>([][]"exception"[][], [][]i[][], [][]"safe!"[][]),[]
[]pstade[][]::[][]new_[][]<[][]S[][]>([][]"exception"[][], [][]i[][], [][]"safe!"[][])[]
[] );[]
[] }[]
[]}[]