Top "Implicit-conversion" questions

Converting an object, variable or value from one type to another to satisfy a type restriction, without specifically requesting that conversion through language syntax.

Why does a generic type constraint result in a no implicit reference conversion error?

I have created a couple of interfaces and generic classes for working with agenda appointments: interface IAppointment<T> …

c# generics implicit-conversion type-constraints
How does SQL Server decide format for implicit datetime conversion?

declare @str_datetime varchar(50) set @str_datetime='30-04-2012 19:01:45' -- 30th April 2012 declare @dt_datetime datetime select @dt_…

sql-server datetime implicit-conversion implicit
How does `is_base_of` work?

How does the following code work? typedef char (&yes)[1]; typedef char (&no)[2]; template <typename B, typename D&…

c++ templates overloading implicit-conversion typetraits
implicit operator using interfaces

I have a generic class that I'm trying to implement implicit type casting for. While it mostly works, it won't …

c# generics compiler-construction casting implicit-conversion
Implicit conversion between Scala.Long and Java.lang.Long in collections

I'm using JavaConverters to go from a Java SortedSet to a Vector. val lines = function.getInstructions.asScala.toVector My getInstructions …

java scala implicit-conversion value-class
Does Swift support implicit conversion?

For example, I have the following code: let numberOfBlocks = 3 let blockWidth = SKSpriteNode(imageNamed: "image.png").size.width let padding = 20.0 let …

ios swift implicit-conversion primitive-types
How do I avoid implicit conversions on non-constructing functions?

How do I avoid implicit casting on non-constructing functions? I have a function that takes an integer as a parameter, …

c++ function casting implicit-conversion implicit-cast
Can you use keyword explicit to prevent automatic conversion of method parameters?

I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can …

c++ implicit-conversion explicit
How do I easily convert from one collection type to another during a filter, map, flatMap in Scala?

Suppose I have a List[Int], and I want to call toString on each element, and get back the result …

scala collections map filter implicit-conversion