与另一个模板的模板专业化

时间:2016-12-05 11:44:20

标签: c++ templates template-specialization template-classes

假设我有两个模板类

template < class T >
class Foo
{
    /**/
};

template < class T >
class Bar
{
     /**/
};

如何将FooBar<T>进行专门化? 什么是语法? 是吗

template<>
template<class T>
class Foo<Bar<T>>
{ /**/ };

template<class T>
class Foo<Bar<T>>
{ /**/ };

或任何其他语法??

1 个答案:

答案 0 :(得分:4)

语法是最后一个:

myapp.controller("DailyController", function($scope) {
  $scope.GetDataAndDrawChart = function(data) {
    // CommmonApi is my service which is fetching data from database.
    $scope.pieData = [{
      name: "Microsoft Internet Explorer",
      y: 56.33
    }, {
      name: "Chrome",
      y: 24.03,
      sliced: true,
      selected: true
    }, {
      name: "Firefox",
      y: 10.38
    }, {
      name: "Safari",
      y: 4.77
    }, {
      name: "Opera",
      y: 0.91
    }, {
      name: "Proprietary or Undetectable",
      y: 0.2
    }]  

  }
});