1对内建类型来说,按值返回的是否为const,是无关紧要的,因为编译器已经不让它成为一个坐直,因为它总是一个值,而不是一个变量(thing in c++ page192) 2当处理用户自定义的类型时,按值返回常量是非常重要的,如果一个函数按值返回一个类对象为const时,那么这个返回值不能是一个左值(即它不能被复制,也不能调用非const函数) #include<iostream> #include<fstream> using namespace std; class X{ in…
There are mutable and Immutable types of Pythons built in types Mutable built-in types: List Set Dictionary Immutable built-in types: String Tuple Number Built-in Types:https://docs.python.org/dev/library/stdtypes.html 主要的内置类型: numerics, sequences, m…