P
P
protalk2016-06-15 16:14:25
Programming languages
protalk, 2016-06-15 16:14:25

Similar to C++11 decltype in other programming languages?

Always in all typed languages ​​with an explicit type declaration, I was tormented by the fact that it was impossible to specify the type of a variable "the same as the variable such and such." I recently learned that decltype appeared in C++11.
Tell me, are there analogues in other programming languages? And if so, in which ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2016-06-15
@protalk

There is in D typeof. Rust has reserved the keyword, but it hasn't been implemented yet. Java / Kotlin has reflection. But this is more heavy stuff.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question