for example I need to access manifest in function def a[A:ClassManifest] to get erasure class. I can use Predef.implicitly function but in that case my code will be as long as if I use full form def a[A](implicit b:ClassManifest[A]).
So is there are convenient generated names for those implicit arguments?
for example I need to access manifest in function def a[A:ClassManifest] to get erasure
Share
There are three predefined methods in
Predefthat will do it forManifests,ClassManifests andOptManifests:manifest[T],classManifest[T]andoptManifest[T], respectively. You can write your own such “implicit getters” for other type classes according to the same pattern. Here is for instancemanifest[T]:So here’s how you could write your own: