Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 21. Implicits > Implicit Conversions

21.1. Implicit Conversions

An implicit conversion function is a function with a single parameter that is declared with the implicit keyword. As the name suggests, such a function is automatically applied to convert values from one type to another.

Here is a simple example. We want to convert integers n to fractions n / 1.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial