Re: [eigen] C++ Syntax Question Regarding Multiple Template<...> |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen development <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] C++ Syntax Question Regarding Multiple Template<...>
- From: Rhys Ulerich <rhys.ulerich@xxxxxxxxx>
- Date: Tue, 25 Mar 2014 23:13:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=kWokbZbU/gLVMPHkkoUf5wlw23l6ILtnZnP2+2BnLG8=; b=M56Q102KJDfRMyswLzg0rfyTg6hDyGDlRxyI0dT3MIyq/5rjNFOSan2SWbpK2GMH62 KnOcbxEtqCzYjSHQKQiwPH+ysXJdDPtNm26VSx6eVQz+zpKXUwnlsv/9yyTiyh/1f2uT psJSSXtduqqq59in2AScaF4UsvlukR5AMS6HTsvuG2K4bwgMj+JU6K1QSSEgvV9I8rfs vlq4lPXpwsOcvlvGbjw14WjNPh0EiYIrq+BhsbQbbxZFC83XH9mPFhCtBXNislF5Q/pC /N7cwy9iBeiz5XNYLBkzvpuvUwuIaMtlrpSo7bHyQVd6wmqSSIa0x2FVrc2l1a3WZuSX FUMw==
My crap attempt at answers, because the questions are interesting not
because I know precisely what I'm talking about.
> 1) Is it necessary to separate the two "template bracket" constructs in the
> definition?
Yes.
> Is this required by the standard and/or is it simply necessary
> to help compilers figure it out?
Required.
> Would it be valid to put everything in one
> "template bracket", i.e.
>
> template<typename Scalar, int _Options, typename _Index, typename
> InputIterators>?
No.
> Inside the template, would the order matter?
Moot as above answer was no.
> 2) My guess is this issue only arises when there is (1) a nested template
> member of a templated type AND (2) the nested template is declared inside
> the definition of the parent but defined later, outside of its parent's
> definition. Is this correct?
I believe so.
> Is there any other circumstance under which one
> may/must iterate multiple template-bracket constructs?
I'm unaware of any.
> 3) If either the parent template type (in this case SparseMatrix) or the
> child template (setFromTriplets) were fully specialized, would it then be
> necessary to have an empty template-bracket construct to represent the
> missing (i.e. specified) types, as in
>
> template<> template<typename InputIterators> void
> SparseMatrix<double>::setFromTriplets...
I think so, but my knowledge is dodgy here.
> Or is
>
> template<typename InputIterators> void
> SparseMatrix<double>::setFromTriplets... enough?
I think not.
> Is the order restricted; that is, if as in that last example, the parent is
> fully specified but the nested template is not, would it be valid to write
>
> template<typename InputIterators> template<> void
> SparseMatrix<double>::setFromTriplets...?
I think so.
You've now written a good interview question that, with your
permission, I will steal.
- Rhys