14.5.4 -9- Class template partial specializationsの制限

  • 手前の型に依存する型でないテンプレート仮引数による部分特殊化はできない
  • boost::mpl::vector_cはlongで決めうちなのでそれ以上のサイズの型では切り捨てが起こる


[]#include[] []<boost/mpl/vector_c.hpp>[]

[]template[][]< [][]class[] []T[][], [][]T[] []t[][] >[]
[]struct[] []A[][];[]

[]template[][]< [][]class[] []T[][] >[]
[]struct[] []A[][]<[][]T[][],[][]5[][]>[]
[]{ }; [][]// C2754 error[]

[]void[] []main[][]()[]
[]{[]
[]__int64[] []const[] []a[][] = [][]99999999999[][];[]
[]typedef[] []boost[][]::[][]mpl[][]::[][]vector_c[][]<[][]__int64[][], [][]99999999999[][]> [][]b[][]; [][]// truncate![]
[]typedef[] []boost[][]::[][]mpl[][]::[][]vector1_c[][]<[][]__int64[][], [][]99999999999[][]> [][]c[][]; [][]// ok[]
[]}[]