Re: Struct template cannot deduce function from argument types

2018-06-27 Thread Luka Aleksic via Digitalmars-d-learn
On Wednesday, 27 June 2018 at 17:07:52 UTC, Jonathan M Davis wrote: On Wednesday, June 27, 2018 16:19:56 Luka Aleksic via Digitalmars-d-learn wrote: [...] [...] Well, for one, what's on the left side of the = doesn't normally affect the type of what's on the right. It does in some cases

Re: Struct template cannot deduce function from argument types

2018-06-27 Thread lithium iodate via Digitalmars-d-learn
On Wednesday, 27 June 2018 at 16:19:56 UTC, Luka Aleksic wrote: […] I am getting the following error: scratch.d(14): Error: struct scratch.pair cannot deduce function from argument types !()(char, int), candidates are: scratch.d(2):scratch.pair(T, U) Failed: ["/usr/bin/dmd", "-v",

Re: Struct template cannot deduce function from argument types

2018-06-27 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jun 27, 2018 at 04:19:56PM +, Luka Aleksic via Digitalmars-d-learn wrote: [...] > struct pair(T, U) { > T first; > U second; > > this(T arg_first, U arg_second) { > first = arg_first; > second = arg_second; > } > }; > > void main()

Re: Struct template cannot deduce function from argument types

2018-06-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, June 27, 2018 16:19:56 Luka Aleksic via Digitalmars-d-learn wrote: > Hello, > > In the following code: > > T first; > U second; > > this(T arg_first, U arg_second) { > first = arg_first; > second = arg_second; > } > }; > > void main() { > > pair!(char, uint)

Struct template cannot deduce function from argument types

2018-06-27 Thread Luka Aleksic via Digitalmars-d-learn
Hello, In the following code: struct pair(T, U) { T first; U second; this(T arg_first, U arg_second) { first = arg_first; second = arg_second; } }; void main() { pair!(char, uint) p1 = pair('a', 1); } I am getting the