C++

Sicstus Prolog – Building a Windows DLL

Written by on August 5, 2018 in C++, Programming, Prolog with 0 Comments
Sicstus Prolog – Building a Windows DLL

Last week I upgraded to the latest version (4.4.1) of Sicstus Prolog for Windows. Since the Prolog engine can be embedded (royalty free) in other applications, it is useful to understand how to create a DLL (on Windows) for this purpose. In today’s article, I would like to outline this process in sufficient detail because I found […]

Continue Reading

Book Review – Design Patterns in Modern C++

Written by on July 22, 2018 in Book Review, C++ with 0 Comments

Title: Design Patterns in Modern C++ – Reusable Approaches for Object-Oriented Software Design Author: Dmitri Nesteruk Publisher: Apress Year: 2018 Luck has been on my side for the past few weeks; I have been getting access to nice books to read. I wrote about The Modern C++ Challenge in my last post. Today, I am going […]

Continue Reading

Book Review – The Modern C++ Challenge

Written by on July 8, 2018 in Book Review, C++, Programming with 0 Comments

Title: The Modern C++ Challenge Author: Marius Bancilla Publisher: Packt Publishing Year: May 2018  This week I have been going through a new book titled The Modern C++ Challenge written by Marius Bancilla. The book is a collection of programming problems (along with suggested solutions) targeting C++ . The title of the book is a […]

Continue Reading

C++17: constexpr if

Written by on December 17, 2017 in C++, Programming with 0 Comments
C++17: constexpr if

constexpr if is another nice little feature in C++17, which significantly simplifies the way we code, especially in the context of templates. In this article, I will briefly talk about this feature and look at some examples. constexpr if is a variant of the standard if statement we have had all along. The primary difference  […]

Continue Reading

C++17: std::any

Written by on December 3, 2017 in C++, Programming with 0 Comments
C++17: std::any

In the previous two posts, I talked about std::variant<> and std::optional<>. Today, I want to take up std::any for discussion. The type any (implemented by the class any) allows a variable to hold a single value of any type. More interestingly, the type of the value held by a variable of type any can even […]

Continue Reading

C++17: std::optional<>

Written by on November 21, 2017 in C++, Programming with 0 Comments
C++17: std::optional<>

Suppose we want to write a function that returns a value, but with the possibility that  the computation might fail. This failure can be represented as an exception, or as a return value that unamibiguously denotes failure (for example, -1). Throwing an exception is a strong form of failure and might not be appropriate in […]

Continue Reading

C++17: std::variant<>

Written by on November 5, 2017 in C++, Programming with 0 Comments
C++17: std::variant<>

C++17 introduces a new type-safe union in the form of std::variant. At any time, it can store a single value from one of many types. We need to include <variant> to use this feature. Let us look at a simple example to get started: First, we define a variant object v1 to hold either an int […]

Continue Reading

C++17: Initialization in Selection Statements

Written by on October 21, 2017 in C++, Programming with 0 Comments
C++17: Initialization in Selection Statements

C++17 enhances if and switch statements with the ability to define  variables whose life-time is limited to the corresponding scope. This is in keeping with the general guideline that variables should have a tight scope, i.e.,  should be defined as close to the point of use as possible and should not live beyond where they […]

Continue Reading

KP Astrology REST API

Written by on August 30, 2017 in Astrology, C++ with 0 Comments
KP Astrology REST API

In today’s post I want to share my experience in implementing a set of REST API calls for Astrology. The series on iLangGen will resume after this. As readers of this column probably know, I am the author of an Astrology software called KPAstro. You can read about it here. First released in the year […]

Continue Reading

C++14: Return Type Deduction for Normal Functions

Written by on April 8, 2016 in C++, Programming with 0 Comments

In C++11, a function must specify its return type in one of the following two ways: int aFunction(int arg) {     return arg * 2; } (or) auto aFunction(int arg) -> int {     return arg * 2; } The first is the classic function definition syntax. The second form was introduced in […]

Continue Reading

Top