--- /dev/null
+CC := c++
+CFLAGS = -std=c++98 -Wall -Wextra -Werror -Wpedantic
+
+ifneq ("$(wildcard .debug)","")
+ CFLAGS += -g
+endif
+
+RM := rm -f
+
+INCDIR := inc
+INCDIR += $(addsuffix /inc, $(SUBPROJECTS));
+ifneq ($(INCLUDE),)
+ INCLUDE := $(addprefix -I, $(INCDIR))
+endif
+
+SRCDIR := .
+
+SOURCES := main.cpp \
+
+SOURCES := $(addprefix $(SRCDIR)/, $(SOURCES))
+
+OBJECTS := $(SOURCES:.cpp=.o)
+
+NAME := easyfind
+
+all : $(NAME)
+
+debug : .debug
+ $(MAKE) all
+
+nodebug :
+ $(RM) .debug
+ $(MAKE) re
+
+.% :
+ $(MAKE) fclean
+ touch $@
+
+$(NAME) : $(OBJECTS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LINKS)
+
+%.o : %.cpp
+ $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE)
+
+clean :
+ $(RM) $(OBJECTS)
+
+fclean : clean
+ $(RM) $(NAME)
+
+re : fclean
+ $(MAKE) all
--- /dev/null
+#ifndef EASYFIND_H
+# define EASYFIND_H
+
+# include <algorithm>
+
+template<typename T>
+int *easyfind(T &int_haystack, int needle)
+{
+ typename T::iterator begin(int_haystack.begin());
+ typename T::iterator end(int_haystack.end());
+ typename T::iterator found(std::find(begin, end, needle));
+
+ if (found == end)
+ return (NULL);
+ return (&(*found));
+}
+
+#endif // EASYFIND_H
--- /dev/null
+#include "easyfind.h"
+#include <iostream>
+#include <vector>
+#include <list>
+#include <set>
+
+template<typename T>
+void test_easyfind(T &cont, int needle)
+{
+ const int *found(easyfind(cont, needle));
+
+ if (found)
+ std::cout
+ << "Found needle " << needle
+ << " at address " << found << '\n';
+ else
+ std::cout << "Needle " << needle << " not found.\n";
+}
+
+int main(void)
+{
+ std::vector<int> vec;
+ std::list<int> list;
+
+ for (int i(0); i < 5; ++i)
+ {
+ vec.push_back(i);
+ list.push_back(2 * i + 5);
+ }
+ test_easyfind(vec, 3);
+ test_easyfind(list, 3);
+ test_easyfind(list, 7);
+ return (0);
+}