Sieve of Eratosthenes is one of the most adopted algorithm to extract the list of prime number. To get the nth prime number however we can do a bit better than just to return the nth from Eratosthenes list.
Default argument allows us to call function omitting some paramater. When a argument is omitted provided default paramater is used. While rust does not support default argument we can make use of macro to achive similar functionality.
Explore the basic idea of function overloading based on number of arguments in rust. For this purpose we make use of declarative macros to implement a basic overloaded add function.
Rc<T> provides shared ownership of a value of type
T, allocated in the heap. Here we are going to look why we need Rc in Rust and using it to write a very simple example.
Intent Grant access to only selected member function to the friend class. Motivation C++ provide no way to Control the granularity of access to the implement details of class. Friend declaration in gives complete access to the internals of class. Friend decleration follow Nothing-or-Everything proposition. Which is …