]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libvtv/testsuite/template-list-iostream.cc
9 extern "C" int printf(const char *, ...);
15 Subscriptor() : counter(1) {}
17 virtual ~Subscriptor()
27 template <int dim
> struct Function
29 Function(int i
): value(dim
+ i
) {}
33 template <int dim
> struct Triangulation
38 template <int dim
> struct Exercise_2_3
44 struct SetUpBase
: public Subscriptor
47 const Function
<dim
> get_boundary_values () const = 0;
50 const Function
<dim
> get_right_hand_side () const = 0;
53 // void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
56 template <class Traits
, int dim
>
57 struct SetUp
: public SetUpBase
<dim
>
62 const Function
<dim
> get_boundary_values () const
63 { return Function
<dim
>(Traits::DIM
); }
66 const Function
<dim
> get_right_hand_side () const
67 { return Function
<dim
>(Traits::DIM
); }
70 // void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
72 // static const typename Traits::BoundaryValues boundary_values;
73 // static const typename Traits::RightHandSide right_hand_side;
77 void myread(std::istream
* in
)
79 char input_str
[50] = "\0";
82 std::cout
<< input_str
<< std::endl
;
92 SetUp<Exercise_2_3<1000>, 2> s1a;
93 SetUp<Exercise_2_3<2000>, 1> s2;
94 SetUp<Exercise_2_3<2000>, 2> s2a;
95 return s1->get_boundary_values().value + s1a.get_boundary_values().value +
96 s2.get_boundary_values().value + s2a.get_boundary_values().value +
97 s1->get_right_hand_side().value + s1a.get_right_hand_side().value +
98 s2.get_right_hand_side().value + s2a.get_right_hand_side().value;
101 SetUp
<Exercise_2_3
<1000>, 1> * s1
= new SetUp
<Exercise_2_3
<1000>, 1>();
103 printf("%d\n", s1
->get_boundary_values().value
);
105 ifstream
* infile
= new ifstream("./template-list-iostream.cc");
109 ofstream
* outfile
= new ofstream("/tmp/xxx.txt");
112 (*outfile
) << "hello there" << std::endl
;
113 std::cerr
<< "Reached End" << std::endl
;