Archives:

How C++11 lambda is implemented No ratings yet.

Quota from a good article from http://www.cprogramming.com/c++11/c++11-lambda-closures.html It turns out that the way lambdas are implemented is by creating a small class; this class overloads the operator(), so that it acts just like a function. A lambda function is an instance of this class; when the class is constructed, any variables in the surrounding enviroment • Read More »


Python @staticmethod, @classmethod No ratings yet.

Found a good one to explain: How @staticmethod and @classmethod are different. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Kls(object):     no_inst = 0   #( this would be class level variable)     def __init__(self, data):         self.data = data  #  (this would be instance variable)      def printd(self):         print(self.data) • Read More »