In C++, alias is a feature introduced in C++11 that allows you to create an 
alias or alternative name for a type. The using keyword is used to create an
alias. Here is an example of how to use alias to create an alias for an existing
type:

Copy code
using IntArray = int[10];
IntArray myArray;
In this example, IntArray is an alias for the type int[10], so myArray is an 
array of 10 integers.

alias has some advantages over typedef:

alias supports all types, including function types, whereas typedef only works 
with fundamental types and user-defined types.
alias allows you to use type aliasing in template code, whereas typedef does not.
alias creates an alias for the type being aliased, not a new type. This means that
the aliased type can be used in the same way as the original type, and it can be
used in template argument deduction.
typedef is an older feature in C++ and it is still used to create an alias for 
a type. It's syntax is powerful feature than typedef in C++. alias allows for more
flexibility and better support for template programming, whereas typedef is 
limited to creating aliases for fundamental types and user-defined types. However,
both alias and typedef can be used to create an alias for a type, it's up to the
developer to decide which one to use depending on the situation.


Here is an example that demonstrates the use of alias and typedef to create an 
alias for a type:

Copy code
#include <vector>
#include <string>

// Using alias to create an alias for a vector of integers
using IntVector = std::vector<int>;
IntVector myIntVector;

// Using typedef to create an alias for a string
typedef std::string MyString;
MyString myString;

// Using alias to create an alias for a pointer to a function
using FuncPtr = void(*)(int, int);
FuncPtr myFunc = [](int a, int b) {
    std::cout << a + b << std::endl;
};
In this example, the using keyword is used to create an alias called IntVector
for the type std::vector<int>. The typedef keyword is used to create an alias
called MyString for the type std::string. The using keyword is also used to 
create an alias called FuncPtr for a pointer to a function that takes 
two integers as arguments and returns void.

As you can see in this example, alias and typedef can be used to create an 
alias for different types, including user-defined types, such as std::vector<int>,
and fundamental types like std::string and also for function pointer types.

Copy code
typedef int MyInt;
MyInt x;
In this example, MyInt is an alias for the type int.

In summary, alias is a more modern and

#include <iostream>
#include <vector>
#include <list>

const char * GetErrorMessage(int errorNo) {
	return "Empty";
}
//typedef const char *(*PFN)(int);
using PFN = const char *(*)(int);
void ShowError(PFN pfn){
	
}
//typedef std::vector < std::list<std::string>> Names;

//template<typename T>
//using Names = std::vector<std::list<T>>;

using Names = std::vector<std::list<std::string>>;

int main() {
	Names names;
	Names nnames;

	PFN pfn = GetErrorMessage;
	ShowError(pfn);
	return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: